| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551 |
- <?php
- namespace addons\CloudStock\common\models;
- use addons\CloudStock\common\events\order\CloudStockChangeEvent;
- use addons\CloudStock\common\events\order\CloudStockChangeSyncEvent;
- use addons\CloudStock\common\logic\order\RestrictPurchases;
- use common\enums\StatusEnum;
- use addons\CloudStock\common\enums\CloudStockEnum;
- use common\models\base\BaseActiveRecord;
- use common\models\goods\Goods;
- use common\models\user\User;
- use common\models\user\UserPartitionRelationship;
- use Yii;
- /**
- * This is the model class for table "{{%addons_cloud_stock_goods_stock_log".
- *
- * @property int $id 自增id
- * @property int $mall_id 商城id
- * @property int $user_id 用户id
- * @property int $goods_id 商品id
- * @property int $changes_dir 库存变动方向;1增加;2减少
- * @property int $order_id 相关的订单id
- * @property int $order_type order类型,1:会员购买订单,2:补货订单;
- * @property int $changes_type 库存变动类型;100向上级补货;101上级给自己配货;102退货退库存;103系统添加;104平台补货赠送;105购买礼包赠送;200会员买货;201给下级配货;202下级向自己补货;203自提货到线下;204系统扣减;
- * @property int $num 数量
- * @property int $status 状态[-1:删除;0:禁用;1启用]
- * @property int $created_at
- * @property int $updated_at
- */
- class CloudStockGoodsStockLog extends BaseActiveRecord
- {
- private static $stock_good = null;
- private static $good = null;
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_cloud_stock_goods_stock_log}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'user_id','goods_id', 'changes_dir', 'order_id', 'order_type', 'changes_type', 'num', 'status', 'created_at', 'updated_at'], 'integer'],
- [['changes_dir', 'changes_type', 'num'], 'required'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => '自增id',
- 'mall_id' => '商城id',
- 'user_id' => '用户id',
- 'goods_id' => '商品id',
- 'changes_dir' => '库存变动方向;1增加;2减少',
- 'order_id' => '相关的订单id',
- 'order_type' => 'order类型,1:会员购买订单,2:补货订单;',
- 'changes_type' => '库存变动类型;100向上级补货;101上级给自己配货;102退货退库存;103系统添加;104平台补货赠送;105购买礼包赠送;200会员买货;201给下级配货;202下级向自己补货;203自提货到线下;204系统扣减;',
- 'num' => '数量',
- 'status' => '状态[-1:删除;0:禁用;1启用]',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- public function getStockDeductionDetail()
- {
- return $this->hasOne(CloudStockDeductionDetail::class, ['stock_log_id' => 'id'])->select(['*']);
- }
- public function getStockIncreaseDetail()
- {
- return $this->hasOne(CloudStockDeductionDetail::class, ['stock_log_id' => 'id'])->select(['*']);
- }
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'user_id'])->select(['*']);
- }
- public function getGoods()
- {
- return $this->hasOne(Goods::class, ['id' => 'goods_id'])->select(['id', 'goods_name', 'cover_pic']);
- }
- public static function setData(int $mall_id, array $data)
- {
- if (!empty($data['id'])) {
- $model = self::findOne(['mall_id' => $mall_id, 'status' => StatusEnum::ENABLED, 'id' => $data['id']]);
- } else {
- $model = new self();
- $model->loadDefaultValues();
- $model->mall_id = $mall_id;
- }
- foreach ($data as $key => $val) {
- $model->$key = $val;
- }
- // dd($model);
- if (!$model->save()) {
- self::$static_error = '保存数据失败:' . $model->getErrorMessage();
- return false;
- }
- return $model;
- }
- /**
- * @name:
- * @msg: 库存处理
- * @param {int} $mall_id
- * @param {array} $data number:商品变动数量;goods_id:商品id,user_id:需要处理的会员id;target_user_id:目标会员id
- * @param {int} $changes_type 库存变动类型,具体参考 CloudStockEnum::getStockChangeTypeMap()
- * @return bool
- */
- public static function stockHandle(int $mall_id, array $data, int $changes_type): bool
- {
- $user_id = $data['user_id'];
- if (empty($data['target_user_id'])) {
- $target_user_id = 0;
- $is_adjoint = 0;
- } else {
- $target_user_id = $data['target_user_id'];
- $is_adjoint = 1;
- }
- try {
- RestrictPurchases::check($mall_id,$data['target_user_id'],[$data['goods_id']],$data['number'],'fill',2);
- }catch (\Exception $e){
- self::$static_error = $e->getMessage();
- return false;
- }
- $transaction = \Yii::$app->db->beginTransaction();
- try {
- $rules = [
- [['goods_id', 'number', 'user_id'], 'required'],
- [['goods_id', 'number', 'user_id', 'target_user_id', 'order_id', 'order_type'], 'integer'],
- [['order_id', 'order_type'], 'required', 'when' => function($model) use($changes_type) {
- if (
- ($changes_type >= CloudStockEnum::STOCK_CHANGE_TYPE100 &&
- $changes_type <= CloudStockEnum::STOCK_CHANGE_TYPE105 &&
- in_array($changes_type, [CloudStockEnum::STOCK_CHANGE_TYPE100, CloudStockEnum::STOCK_CHANGE_TYPE102])) && // 增/减库存分界线,上分下减
- $changes_type >= CloudStockEnum::STOCK_CHANGE_TYPE200 &&
- $changes_type <= CloudStockEnum::STOCK_CHANGE_TYPE204
- ) {
- return true;
- } else {
- return false;
- }
- }],
- ];
- $res = \Yii::$app->services->validate->validate($data, $rules);
- if ($res === false) throw new \Exception(\Yii::$app->services->validate->getErrorMessage());
- if ($changes_type >= CloudStockEnum::STOCK_CHANGE_TYPE100 && $changes_type <= CloudStockEnum::STOCK_CHANGE_TYPE105) {
- // 加库存
- $changes_dir = CloudStockEnum::STOCK_CHANGE_ADD;
- } else if ($changes_type >= CloudStockEnum::STOCK_CHANGE_TYPE200 && $changes_type <= CloudStockEnum::STOCK_CHANGE_TYPE204) {
- // 减库存
- $changes_dir = CloudStockEnum::STOCK_CHANGE_SUB;
- } else {
- throw new \Exception('不支持的库存变动类型');
- }
- $data['target_user_id'] = $target_user_id;
- // 检查会员两方是否符合条件
- self::checkAgenUser($mall_id, $data, $is_adjoint);
- // 检查商品
- self::checkAgentGood($mall_id, $data,$changes_dir);
- // dd($changes_dir, $changes_type);
- $adjoint_change_type = self::adjointChangeType($changes_type);
- if (0 != $adjoint_change_type) {
- // 共轭变动明细需要记录
- // 处理共轭变动会员的库存并记录log
- if (empty($data['target_user_id'])) throw new \Exception('目标会员id不能为空');
- $adjoint_change_dir = self::adjointChangeDir($changes_dir);
- $data['user_id'] = $data['target_user_id'];
- $configs = \Yii::$app->services->setting->addons->get($mall_id, CloudStockEnum::ADDONS_NAME, 'basic');
- $is_can_pick_free = $configs['is_can_pick_free'] ?? 0;
- // if (1 == $is_can_pick_free) {
- //允许自由配货,下级没有的商品也可以直接配货
- //检查商品
- self::checkAgentGood($mall_id, $data,$adjoint_change_dir);
- // }
- // 处理当前会员库存增减并记录log
- $adjoint_change_dir_id = self::agentUserSaveLog($mall_id, $data, $adjoint_change_dir, $adjoint_change_type);
- }
- // 处理当前会员库存增减并记录log
- $data['user_id'] = $user_id;
- $changes_dir_id = self::agentUserSaveLog($mall_id, $data, $changes_dir, $changes_type);
- CloudStockAgent::fixStock($mall_id,$data['user_id']);//扣减库存
- CloudStockAgent::fixStock($mall_id,$data['target_user_id']);//增加库存
- $transaction->commit();
- if (isset($adjoint_change_dir_id) && isset($adjoint_change_dir)) {
- //触发库存变动事件
- $event = new CloudStockChangeSyncEvent($mall_id);
- $event_data = [
- 'id' => $adjoint_change_dir_id,
- 'type' => $adjoint_change_dir,
- 'mall_id' => $mall_id,
- ];
- \Yii::$app->services->events->dispatch($event, $event_data, $event->listeners);
- }
- if (isset($changes_dir_id)) {
- //触发库存变动事件
- $event = new CloudStockChangeSyncEvent($mall_id);
- $event_data = [
- 'id' => $changes_dir_id,
- 'type' => $changes_dir,
- 'mall_id' => $mall_id,
- ];
- \Yii::$app->services->events->dispatch($event, $event_data, $event->listeners);
- }
- return true;
- } catch (\Exception $e) {
- \Yii::error($e->getMessage() . ', file: ' . $e->getFile() . ', line: ' . $e->getLine());\Yii::getLogger()->flush(true);
- self::$static_error = $e->getMessage();
- $transaction->rollBack();
- return false;
- }
- }
- /**
- * @name:
- * @msg: 库存处理
- * @param {int} $mall_id
- * @param {array} $data number:商品变动数量;goods_id:商品id,user_id:需要处理的会员id;target_user_id:目标会员id
- * @param {int} $changes_type 库存变动类型,具体参考 CloudStockEnum::getStockChangeTypeMap()
- * @return bool
- */
- public static function stockHandleV2(int $mall_id, array $data, int $changes_type): bool
- {
- $user_id = $data['user_id'];
- if (empty($data['target_user_id'])) {
- $target_user_id = 0;
- $is_adjoint = 0;
- } else {
- $target_user_id = $data['target_user_id'];
- $is_adjoint = 1;
- }
- $transaction = \Yii::$app->db->beginTransaction();
- try {
- $rules = [
- [['user_id'], 'required'],
- [['user_id', 'target_user_id', 'order_id', 'order_type'], 'integer'],
- [['order_info'], 'safe'],
- [['order_id', 'order_type'], 'required', 'when' => function($model) use($changes_type) {
- if (
- ($changes_type >= CloudStockEnum::STOCK_CHANGE_TYPE100 &&
- $changes_type <= CloudStockEnum::STOCK_CHANGE_TYPE105 &&
- in_array($changes_type, [CloudStockEnum::STOCK_CHANGE_TYPE100, CloudStockEnum::STOCK_CHANGE_TYPE102])) && // 增/减库存分界线,上分下减
- $changes_type >= CloudStockEnum::STOCK_CHANGE_TYPE200 &&
- $changes_type <= CloudStockEnum::STOCK_CHANGE_TYPE204
- ) {
- return true;
- } else {
- return false;
- }
- }],
- ];
- $res = \Yii::$app->services->validate->validate($data, $rules);
- if ($res === false) throw new \Exception(\Yii::$app->services->validate->getErrorMessage());
- if ($changes_type >= CloudStockEnum::STOCK_CHANGE_TYPE100 && $changes_type <= CloudStockEnum::STOCK_CHANGE_TYPE105) {
- // 加库存
- $changes_dir = CloudStockEnum::STOCK_CHANGE_ADD;
- } else if ($changes_type >= CloudStockEnum::STOCK_CHANGE_TYPE200 && $changes_type <= CloudStockEnum::STOCK_CHANGE_TYPE204) {
- // 减库存
- $changes_dir = CloudStockEnum::STOCK_CHANGE_SUB;
- } else {
- throw new \Exception('不支持的库存变动类型');
- }
- $data['target_user_id'] = $target_user_id;
- // 检查会员两方是否符合条件
- self::checkAgenUser($mall_id, $data, $is_adjoint);
- $adjoint_change_type = self::adjointChangeType($changes_type);
- foreach ($data['order_info'] as $orderItem) {
- $data['goods_id'] = $orderItem['goods_id'];
- $data['number'] = $orderItem['num'];
- // 检查商品
- self::checkAgentGood($mall_id, $data, $changes_dir);
- // dd($changes_dir, $changes_type);
- if (0 != $adjoint_change_type) {
- // 共轭变动明细需要记录
- // 处理共轭变动会员的库存并记录log
- if (empty($data['target_user_id'])) throw new \Exception('目标会员id不能为空');
- $adjoint_change_dir = self::adjointChangeDir($changes_dir);
- $data['user_id'] = $data['target_user_id'];
- $configs = \Yii::$app->services->setting->addons->get($mall_id, CloudStockEnum::ADDONS_NAME, 'basic');
- $is_can_pick_free = $configs['is_can_pick_free'] ?? 0;
- // if (1 == $is_can_pick_free) {
- //允许自由配货,下级没有的商品也可以直接配货
- //检查商品
- self::checkAgentGood($mall_id, $data,$adjoint_change_dir);
- // }
- // 处理当前会员库存增减并记录log
- $adjoint_change_dir_id = self::agentUserSaveLog($mall_id, $data, $adjoint_change_dir, $adjoint_change_type);
- }
- // 处理当前会员库存增减并记录log
- $data['user_id'] = $user_id;
- $changes_dir_id = self::agentUserSaveLog($mall_id, $data, $changes_dir, $changes_type);
- }
- CloudStockAgent::fixStock($mall_id,$data['user_id']);//扣减库存
- CloudStockAgent::fixStock($mall_id,$data['target_user_id']);//增加库存
- $transaction->commit();
- if (isset($adjoint_change_dir_id) && isset($adjoint_change_dir)) {
- //触发库存变动事件
- $event = new CloudStockChangeSyncEvent($mall_id);
- $event_data = [
- 'id' => $adjoint_change_dir_id,
- 'type' => $adjoint_change_dir,
- 'mall_id' => $mall_id,
- ];
- \Yii::$app->services->events->dispatch($event, $event_data, $event->listeners);
- }
- if (isset($changes_dir_id)) {
- //触发库存变动事件
- $event = new CloudStockChangeSyncEvent($mall_id);
- $event_data = [
- 'id' => $changes_dir_id,
- 'type' => $changes_dir,
- 'mall_id' => $mall_id,
- ];
- \Yii::$app->services->events->dispatch($event, $event_data, $event->listeners);
- }
- return true;
- } catch (\Exception $e) {
- \Yii::error($e->getMessage() . ', file: ' . $e->getFile() . ', line: ' . $e->getLine());\Yii::getLogger()->flush(true);
- self::$static_error = $e->getMessage();
- $transaction->rollBack();
- return false;
- }
- }
- /**
- * @name:
- * @msg: 检查会员两方是否符合条件
- * @param {int} $mall_id
- * @param {array} $data user_id target_user_id
- * @return {*}
- */
- private static function checkAgenUser(int $mall_id, array $data, int $is_adjoint = 1)
- {
- $agent = CloudStockAgent::findOne(['mall_id' => $mall_id, 'user_id' => $data['user_id'], 'status' => StatusEnum::ENABLED]);
- if (empty($agent)) {
- throw new \Exception('当前会员不是代理商');
- }
- if (!empty($is_adjoint)) {
- $parent_ids = UserPartitionRelationship::getParentIdArr($data['target_user_id']);
- if (!in_array($data['user_id'], $parent_ids)) {
- throw new \Exception('对方不是你的下级会员,不能配货');
- }
- $sub_agent = CloudStockAgent::findOne(['mall_id' => $mall_id, 'user_id' => $data['target_user_id'], 'status' => StatusEnum::ENABLED]);
- if (empty($sub_agent)) {
- throw new \Exception('对方不是代理商');
- }
- }
- return true;
- }
- /**
- * @name:
- * @msg: 检查商品状态
- * @param {int} $mall_id
- * @param {array} $data goods_id:商品id,user_id:当前会员id
- * @return {*}
- */
- private static function checkAgentGood(int $mall_id, array $data, $changes_dir)
- {
- $good = Goods::findOne(['mall_id' => $mall_id, 'status' => StatusEnum::ENABLED, 'id' => $data['goods_id'], 'is_on_sale' => 1, 'is_attr' => 0]);
- if (empty($good)) throw new \Exception('商品数据异常');
- $stock_good = CloudStockAgentGoods::findOne(['mall_id' => $mall_id, 'user_id' => $data['user_id'], 'goods_id' => $data['goods_id'], 'status' => StatusEnum::ENABLED]);
- if (empty($stock_good)) {
- // throw new \Exception('未找到代理商品,请先补货');
- $stock_good = new CloudStockAgentGoods();
- $stock_good->loadDefaultValues();
- $stock_good->mall_id = $mall_id;
- $stock_good->goods_id = $data['goods_id'];
- $stock_good->user_id = $data['user_id'];
- $stock_good->num = 0;
- $stock_good->save();
- }
- if ($changes_dir == CloudStockEnum::STOCK_CHANGE_SUB) {
- if ($data['number'] > $stock_good['num']) {
- throw new \Exception('商品库存不足');
- }
- }
- self::$good = $good;
- self::$stock_good = $stock_good;
- return true;
- }
- /**
- * @name:
- * @msg: 获取共轭改变类型。例如:当前会员的改变类型是给下级配货(201),则其共轭改变类型就是 上级给自己配货(101)
- * @param {int} $change_type
- * @return {*}
- */
- private static function adjointChangeType(int $changes_type = null)
- {
- $adjoint_change_type_map = [
- CloudStockEnum::STOCK_CHANGE_TYPE100 => CloudStockEnum::STOCK_CHANGE_TYPE202,
- CloudStockEnum::STOCK_CHANGE_TYPE101 => CloudStockEnum::STOCK_CHANGE_TYPE201,
- CloudStockEnum::STOCK_CHANGE_TYPE102 => 0,
- CloudStockEnum::STOCK_CHANGE_TYPE103 => 0,
- CloudStockEnum::STOCK_CHANGE_TYPE104 => 0,
- CloudStockEnum::STOCK_CHANGE_TYPE105 => 0,
- CloudStockEnum::STOCK_CHANGE_TYPE200 => 0,
- CloudStockEnum::STOCK_CHANGE_TYPE201 => CloudStockEnum::STOCK_CHANGE_TYPE101,
- CloudStockEnum::STOCK_CHANGE_TYPE202 => CloudStockEnum::STOCK_CHANGE_TYPE100,
- CloudStockEnum::STOCK_CHANGE_TYPE203 => 0,
- CloudStockEnum::STOCK_CHANGE_TYPE204 => 0,
- ];
- if (!empty($changes_type)) $adjoint_change_type_map = $adjoint_change_type_map[$changes_type];
- return $adjoint_change_type_map;
- }
- /**
- * @name:
- * @msg: 获取共轭变动方向
- * @param {int} $changes_dir 当前变动方向
- * @return mixed
- */
- private static function adjointChangeDir(int $changes_dir = null)
- {
- $adjoint_change_dir_map = [
- CloudStockEnum::STOCK_CHANGE_ADD => CloudStockEnum::STOCK_CHANGE_SUB,
- CloudStockEnum::STOCK_CHANGE_SUB => CloudStockEnum::STOCK_CHANGE_ADD,
- ];
- if (!empty($changes_dir)) $adjoint_change_dir_map = $adjoint_change_dir_map[$changes_dir];
- return $adjoint_change_dir_map;
- }
- /**
- * @name:
- * @msg: 代理商库存处理并记录明细
- * @param {int} $mall_id
- * @param {array} $data goods_id:商品id,user_id:需要处理的会员id;order_id:订单id,非必需;order_type:订单类型,非必需;number:商品变动数量;
- * @param {int} $changes_dir
- * @param {int} $changes_type
- * @return {*}
- */
- private static function agentUserSaveLog(int $mall_id, array $data, int $changes_dir, int $changes_type)
- {
- // 当前会员库存明细记录 --- start ----
- $params_sub = [
- 'goods_id' => $data['goods_id'],
- 'changes_dir' => $changes_dir,
- 'user_id' => $data['user_id'],
- 'order_id' => $data['order_id'] ?? 0,
- 'order_type' => $data['order_type'] ?? 0,
- 'changes_type' => $changes_type,
- 'num' => $data['number'],
- 'status' => StatusEnum::ENABLED,
- ];
- $res_save_log = self::setData($mall_id, $params_sub);
- if (false === $res_save_log) {
- throw new \Exception(self::$static_error);
- }
- // 当前会员减库存明细记录 --- end ----
- // 当前会员库存增减明细表数据记录 --- start ---
- // unset($stock_good);
- $stock_good = CloudStockAgentGoods::findOne(['mall_id' => $mall_id, 'user_id' => $data['user_id'], 'goods_id' => $data['goods_id'], 'status' => StatusEnum::ENABLED]);
- if (empty($stock_good)) {
- $msg = '代理商商品未找到';
- if ($data['user_id'] == $data['target_user_id']) {
- $msg = '需要下级代理商进货过该商品之后才可以配货';
- }
- throw new \Exception($msg);
- }
- // $msg = __METHOD__ . ' ======= mall_id => ' . $mall_id . ', data => ' . var_export($data, true) . ', changes_dir => ' . $changes_dir . ', changes_type => ' . $changes_type . ', stock_good->num => ' . $stock_good->num . PHP_EOL;
- // \Yii::error($msg);\Yii::getLogger()->flush(true);
- if (CloudStockEnum::STOCK_CHANGE_SUB == $changes_dir) {
- // 减库存
- $good_change_number = max($stock_good->num - $data['number'], 0);
- $deduction_params = [
- 'user_id' => $data['user_id'],
- 'num' => $data['number'],
- 'mall_id'=>$mall_id,
- 'goods_id' => $data['goods_id'],
- 'order_id' => $data['order_id'] ?? 0,
- 'order_type' => $data['order_type'] ?? 0,
- 'changes_type' => $changes_type,
- 'not_yet_num' => $good_change_number,
- 'stock_log_id' => $res_save_log->id,
- 'status' => StatusEnum::ENABLED,
- ];
- $res_deduct = CloudStockDeductionDetail::setData($deduction_params);
- if (false === $res_deduct) {
- throw new \Exception(self::$static_error);
- }
- $id = $res_deduct->id;
- } else {
- // 加库存
- $good_change_number = $stock_good->num + $data['number'];
- $add_params = [
- 'user_id' => $data['user_id'],
- 'num' => $data['number'],
- 'mall_id'=>$mall_id,
- 'goods_id' => $data['goods_id'],
- 'order_id' => $data['order_id'] ?? 0,
- 'order_type' => $data['order_type'] ?? 0,
- 'changes_type' => $changes_type,
- 'stock_log_id' => $res_save_log->id,
- 'status' => StatusEnum::ENABLED,
- ];
- $res_add = CloudStockIncreaseDetail::setData($add_params);
- if (false === $res_add) {
- throw new \Exception(self::$static_error);
- }
- $id = $res_add->id;
- }
- // 当前会员库存增减明细表数据记录 --- end ---
- // 当前会员代理商品记录表相应商品数量变动更新 ---- start -----
- if (empty($stock_good)) {
- $update_stock_good_params = [
- 'user_id' => $data['user_id'],
- 'goods_id' => $data['goods_id'],
- 'num' => $data['number'],
- ];
- } else {
- $update_stock_good_params = [
- 'id' => $stock_good->id,
- 'num' => $good_change_number,
- ];
- }
- $res_agenuser_update = CloudStockAgentGoods::setData($mall_id, $update_stock_good_params);
- if (false === $res_agenuser_update) {
- throw new \Exception(self::$static_error);
- }
- // 当前会员代理商品记录表相应商品数量变动更新 ---- end -----
- unset($res_save_log);
- return $id;
- }
- }
|