Commit 8a1d1e22 authored by sugar's avatar sugar

首页样谱

parent 168a1e58
Pipeline #738 canceled with stages
......@@ -89,6 +89,16 @@ class Article extends Api{
if($action == 'center'){
$where = ['ea.user_id' =>$uid];
}
if(!$this->auth->province_id){
$addr_arr = [
'province_id' =>$province_id,
'city_id' =>$city_id,
'area_id' =>$area_id,
'town_id' =>$town_id,
'village_id' =>$village_id,
];
\app\common\model\User::update($addr_arr,['id' =>$this->auth->id]);
}
/* if(!$people){
$this->error('查无此人');
}*/
......@@ -105,25 +115,13 @@ class Article extends Api{
break;
case 3:
$city_id = Addr::where(['ID' =>$area_id])->value('ParentId');
$where['ea.city_id'] = $city_id;
$where['ea.city_id'] = $this->auth->city_id;
break;
case 4:
$where['ea.area_id'] = $area_id;
$where['ea.area_id'] = $this->auth->area_id;
break;
case 5:
if(!$this->auth->village_id){
$addr_arr = [
'province_id' =>$province_id,
'city_id' =>$city_id,
'area_id' =>$area_id,
'town_id' =>$town_id,
'village_id' =>$village_id,
];
\app\common\model\User::update($addr_arr,['id' =>$this->auth->id]);
$where['ea.village_id'] = $village_id;
}else{
$where['ea.village_id'] = $this->auth->village_id;
}
$where['ea.village_id'] = $this->auth->village_id;
break;
}
......
......@@ -29,7 +29,7 @@ class Auth
//默认配置
protected $config = [];
protected $options = [];
protected $allowFields = ['id', 'username', 'nickname', 'mobile', 'avatar', 'score', 'prevtime' ,'wx_openid', 'app_openid', 'unionid', 'money', 'level','is_shaikh','commission','agent_money'];
protected $allowFields = ['id', 'username', 'nickname', 'mobile', 'avatar', 'score', 'prevtime' ,'wx_openid', 'app_openid', 'unionid', 'money', 'level','is_shaikh','commission','agent_money', 'province_id', 'city_id','area_id','town_id','village_id'];
public function __construct($options = [])
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment