quanwei
2 days ago 04102f7237efefa744090ed7c25f7b5d0807b679
admin/app/api/model/plus/release/DemandProject.php
@@ -30,7 +30,7 @@
    /**
     * 新增记录
     */
    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'])) {
@@ -69,7 +69,7 @@
            $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);
            // 记录图片
@@ -85,6 +85,10 @@
                    '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'];
        });