getRewardUnitPrice(); //没有设置奖励金额 if (empty($this->reward_unit_price)) return false; //扣库存数量为0;没有奖励 if (empty($this->goods_num)) return false; if ($this->is_job) return true; $insert_wallet = $this->getInsertWallet(UserWalletEnum::OVER); if ($insert_wallet) CloudStockTwoAgent::sendUserWalletQueue($insert_wallet); } public function getRewardUnitPrice() { $level = CloudStockTwoLevel::findOne(['mall_id' => $this->mall_id, 'level' => $this->bonus_agent['level'], 'status' => StatusEnum::ENABLED]); switch ($this->over_level) { case 1: $over_level_list = json_decode($this->stock_goods['over_level_list'], true); $this->reward_unit_price = 0; break; case 2: if(!empty($this->stock_goods['over_level_list_2'])){ $over_level_list_2 = json_decode($this->stock_goods['over_level_list_2'], true); $over_level_list = $over_level_list_2; } break; default: $this->reward_unit_price = 0; return; } if (!empty($level) && !empty($over_level_list)) { foreach ($over_level_list as $value) { if ($value['level'] == $this->bonus_agent->level) { $this->reward_unit_price = $value['price']; return; } } } $this->reward_unit_price = 0; } }