...
|
...
|
@@ -832,6 +832,7 @@ class Index extends Api |
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/Index/BusinessList)
|
|
|
* @ApiHeaders (name=token, type=string, required=false, description="请求的Token")
|
|
|
* @ApiParams (name="keywords", type="int", required=true, description="索引")
|
|
|
* @ApiParams (name="pages", type="int", required=true, description="pages")
|
|
|
* @ApiParams (name="rows", type="int", required=true, description="rows")
|
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
|
...
|
...
|
@@ -845,9 +846,14 @@ class Index extends Api |
|
|
{
|
|
|
$SellerId = $this->IsTokenSeller($this->request->header());
|
|
|
$Params = $this->request->param();
|
|
|
$Map = [];
|
|
|
if (!empty($Params['keywords']) || $Params['keywords'] != '' || $Params['keywords'] != null) {
|
|
|
$Map['u.nickname'] = ['LIKE', '%' . $Params['keywords'] . '%'];
|
|
|
}
|
|
|
$Array = Db::name('business')->where('seller_id', $SellerId)
|
|
|
->alias('b')
|
|
|
->join('user u', 'u.id=b.user_id')
|
|
|
->where($Map)
|
|
|
->order('b.createtime desc')
|
|
|
->field('b.id,b.user_id,u.avatar,u.nickname,b.createtime')
|
|
|
->select();
|
...
|
...
|
@@ -1104,8 +1110,8 @@ class Index extends Api |
|
|
|
|
|
/**
|
|
|
* 首页接口
|
|
|
* @ApiTitle (删除未发布讣告)
|
|
|
* @ApiSummary (删除未发布讣告)
|
|
|
* @ApiTitle (删除未发布讣告-用户)
|
|
|
* @ApiSummary (删除未发布讣告-用户)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/Index/DelUserOb)
|
|
|
* @ApiHeaders (name=token, type=string, required=false, description="请求的Token")
|
...
|
...
|
@@ -1128,4 +1134,31 @@ class Index extends Api |
|
|
$Res = Db::name('ob')->where('user_id', $UserId)->where('id', $Params['ob_id'])->delete();
|
|
|
$this->Res($Res);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 首页接口
|
|
|
* @ApiTitle (删除未发布讣告-商户)
|
|
|
* @ApiSummary (删除未发布讣告-商户)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/Index/DelSellerOb)
|
|
|
* @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 DelSellerOb()
|
|
|
{
|
|
|
$SellerId = $this->IsTokenSeller($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('seller_id', $SellerId)->where('id', $Params['ob_id'])->delete();
|
|
|
$this->Res($Res);
|
|
|
}
|
|
|
} |
...
|
...
|
|