作者 王智

1

... ... @@ -1082,4 +1082,32 @@ class Index extends Api
}
$this->success('成功', $data);
}
/**
* 首页接口
* @ApiTitle (删除未发布讣告)
* @ApiSummary (删除未发布讣告)
* @ApiMethod (POST)
* @ApiRoute (/api/Index/DelUserOb)
* @ApiHeaders (name=token, type=string, required=false, description="请求的Token")
* @ApiParams (name="ob_id", type="int", required=true, description="讣告ID")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturn ({
'code':'1',
'msg':'返回成功',
})
*/
public function DelUserOb()
{
$UserId = $this->IsToken($this->request->header());
$Params = $this->request->param();
$ObInfo = Db::name('ob')->where('id', $Params['ob_id'])->find();
if ($ObInfo['on'] == 1) {
$this->error('已发布无法删除');
}
$Res = Db::name('ob')->where('user_id', $UserId)->where('id', $Params['ob_id'])->delete();
$this->Res($Res);
}
}
... ...