@@ -121,4 +121,20 @@ class SupplyDemandInfoController extends BaseApiController
$result = SupplyDemandLogic::getCateList($params,$this->userId);
return $this->data($result);
}
+ public function delete(){
+ if($this->request->isPost()) {
+
+ $params = (new SupplyDemandValidate())->post()->goCheck('delete');
+ $result = SupplyDemandLogic::delete($params);
+ if (true === $result) {
+ return $this->success('删除成功', [], 1, 1);
+ }
+ }else{
+ return $this->fail('请求方式错误');
@@ -72,6 +72,15 @@ class SupplyDemandLogic extends BaseLogic
+ public static function delete(array $params){
+ try {
+ SupplyDemandInfo::destroy($params['id']);
+ return true;
+ } catch (\Exception $e) {
+ self::setError($e->getMessage());
+ return false;
public static function submitSupplyDemand(array $params)
{
try {
@@ -60,7 +60,8 @@ class SupplyDemandValidate extends BaseValidate
'supplyDemandRelease' => ['title','type','images','address','mobile','number','cate_id'], //
'info' => ['id'], //
'cate' => ['type'],
- 'submitSupplyDemand'=>['id']
+ 'submitSupplyDemand'=>['id'],
+ 'delete'=>['id']
];
/**