| | |
| | | /** |
| | | * 新增记录 |
| | | */ |
| | | public function add($postdata,$demand,$pay_price) |
| | | public function add($postdata,$demand,$pay_price,$publish_rewards) |
| | | { |
| | | $data = json_decode($postdata["formData"],true); |
| | | if (empty($data['name'])) { |
| | |
| | | $save_data["finish_time"] = ''; |
| | | } |
| | | |
| | | return $this->transaction(function () use ($data, $save_data,$pay_price) { |
| | | return $this->transaction(function () use ($data, $save_data,$pay_price,$publish_rewards) { |
| | | // 记录内容 |
| | | $this->save($save_data); |
| | | // 记录图片 |
| | |
| | | 'app_id' => $save_data['app_id'], |
| | | ]); |
| | | } |
| | | if($publish_rewards>0){ |
| | | $user=(new UserModel())->where('user_id', '=', $save_data['user_id'])->find(); |
| | | $user->setIncConsumption($publish_rewards,'发布供应奖励消费券'); |
| | | } |
| | | |
| | | return $this['project_id']; |
| | | }); |