作者 王智

1

@@ -1082,4 +1082,32 @@ class Index extends Api @@ -1082,4 +1082,32 @@ class Index extends Api
1082 } 1082 }
1083 $this->success('成功', $data); 1083 $this->success('成功', $data);
1084 } 1084 }
  1085 +
  1086 +
  1087 + /**
  1088 + * 首页接口
  1089 + * @ApiTitle (删除未发布讣告)
  1090 + * @ApiSummary (删除未发布讣告)
  1091 + * @ApiMethod (POST)
  1092 + * @ApiRoute (/api/Index/DelUserOb)
  1093 + * @ApiHeaders (name=token, type=string, required=false, description="请求的Token")
  1094 + * @ApiParams (name="ob_id", type="int", required=true, description="讣告ID")
  1095 + * @ApiReturnParams (name="code", type="integer", required=true, sample="0")
  1096 + * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
  1097 + * @ApiReturn ({
  1098 + 'code':'1',
  1099 + 'msg':'返回成功',
  1100 + })
  1101 + */
  1102 + public function DelUserOb()
  1103 + {
  1104 + $UserId = $this->IsToken($this->request->header());
  1105 + $Params = $this->request->param();
  1106 + $ObInfo = Db::name('ob')->where('id', $Params['ob_id'])->find();
  1107 + if ($ObInfo['on'] == 1) {
  1108 + $this->error('已发布无法删除');
  1109 + }
  1110 + $Res = Db::name('ob')->where('user_id', $UserId)->where('id', $Params['ob_id'])->delete();
  1111 + $this->Res($Res);
  1112 + }
1085 } 1113 }