@@ -67,6 +67,36 @@ class SupplyDemandInfoController extends BaseApiController
}
+ public function submitSupplyDemandInfo()
+ {
+ if($this->request->isPost()) {
+
+ $params = (new SupplyDemandValidate())->post()->goCheck('submitSupplyDemand');
+ $userId = $this->userId;
+ $params['user_id'] = $userId;
+ $result = SupplyDemandLogic::submitSupplyDemand($params);
+ if (true === $result) {
+ switch ($params['type']){
+ case 1 :
+ $type_name = '供应';
+ break;
+ case 2 :
+ $type_name = '需求';
+ break ;
+ default :
+ $type_name = '';
+ }
+ return $this->success($type_name.'信息提交审核成功', [], 1, 1);
+ }else{
+ return $this->fail('请求方式错误');
/**
* @notes 供需列表
* @return \think\response\Json
@@ -72,7 +72,18 @@ class SupplyDemandLogic extends BaseLogic
-
+ public static function submitSupplyDemand(array $params)
+ try {
+ $updateWhere['id'] = $params['id'];
+ $updatedata['status'] = 1;
+ SupplyDemandInfo::where($updateWhere)->update($updatedata);
+ return true;
+ } catch (\Exception $e) {
+ self::setError($e->getMessage());
+ return false;
* @notes
* @param $params
@@ -59,7 +59,8 @@ class SupplyDemandValidate extends BaseValidate
protected $scene = [
'supplyDemandRelease' => ['title','type','images','address','mobile','number','cate_id'], //
'info' => ['id'], //
- 'cate' => ['type']
+ 'cate' => ['type'],
+ 'submitSupplyDemand'=>['id']
];