| | |
| | | { |
| | | $postData = $this->postData(); |
| | | $model = new ProjectModel; |
| | | if(empty($this->supply)){ |
| | | return $this->renderError('未找到供应用户信息,请先成为供应用户'); |
| | | } |
| | | $user_id = $this->supply['user_id']; |
| | | |
| | | return $this->renderSuccess('', [ |
| | | // 用户信息 |
| | | 'supplyuser' => $this->supply, |
| | |
| | | $setting = $setting['settlement']['values']; |
| | | $user = $this->user; |
| | | $pay_price = empty($setting['supply_price']) ? 0 : $setting['supply_price']; |
| | | $publish_rewards = empty($setting['publish_rewards']) ? 0 : $setting['publish_rewards']; |
| | | $point = $user['points']; |
| | | if($pay_price > $point){ |
| | | return $this->renderError('连盟币不足'); |
| | | } |
| | | if(empty($this->supply)){ |
| | | return $this->renderError('未找到供应用户信息,请先成为供应用户'); |
| | | } |
| | | $model = new ProjectModel; |
| | | if ($model->add($postData,$this->supply, $pay_price)) { |
| | | if ($model->add($postData,$this->supply, $pay_price,$publish_rewards)) { |
| | | return $this->renderSuccess('提交成功'); |
| | | } |
| | | return $this->renderError($model->getError() ?: '提交失败'); |