作者 郭盛
1 个管道 的构建 通过 耗费 11 秒

修改接口

... ... @@ -197,7 +197,6 @@ class Index extends Api
* @ApiMethod (POST)
* @ApiRoute (/api/index/history)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="city_name", type="inter", required=true, description="城市名称")
*
* @ApiReturn({
"code": 1,
... ... @@ -218,11 +217,11 @@ class Index extends Api
*/
public function history()
{
$city_name = $this->request->param('city_name');
if(empty($city_name)){
$this->error('城市名称不能为空');
}
$city_id = Db::name('area')->where('name',$city_name)->value('id');
// $city_name = $this->request->param('city_name');
// if(empty($city_name)){
// $this->error('城市名称不能为空');
// }
// $city_id = Db::name('area')->where('name',$city_name)->value('id');
$token = $this->request->header('token');
if(!empty($token)){
$user_id = $this->getUserId();
... ... @@ -235,7 +234,7 @@ class Index extends Api
}
$data['hotlist'] = Db::name('hot')
->field('id,name')
->where('area_id',$city_id)
// ->where('area_id',$city_id)
->order('id desc')
->limit(10)
->select();
... ...
... ... @@ -91,6 +91,18 @@ class Info extends Api
if($record['jifen'] == ''){
$record['jifen'] = 0;
}
//查看是否是商家
$application = Db::name('application')
->where('user_id',$user_id)
->where('status',1)
->find();
if($application){
$data['is_real'] = 1;
}else{
$data['is_real'] = 2;
}
$data['score'] = $user['score'];
$data['card'] = $record['jifen'];
$data['total'] = $data['score'] + $data['card'];
... ...