Commit 043875ce authored by wuxiaoli's avatar wuxiaoli

no message

parent 5e254bbe
Pipeline #750 canceled with stages
......@@ -376,25 +376,29 @@ class Friend extends Api{
}else if($type==3){//同乡
$where['village_id'] = $this->auth->village_id;
}else if($type==4){//同校
$educational=UsersModel::where(['id'=>$this->auth->id])->value("educational");
$school=array_column(json_decode($educational), "school");
$where = '';
foreach ($school as $k=>$v){
if($k==0){
$where = " educational like '%".$v."%'";
}else{
$where = $where. " OR educational like '%".$v."%'";
$educational=UsersModel::where(['id'=>$this->auth->id])->value("educational");
if($educational){
$school=array_column(json_decode($educational), "school");
foreach ($school as $k=>$v){
if($k==0){
$where = " educational like '%".$v."%'";
}else{
$where = $where. " OR educational like '%".$v."%'";
}
}
}
}else if($type==5){//同事
$work_experience=UsersModel::where(['id'=>$this->auth->id])->value("work_experience");
$company=array_column(json_decode($work_experience), "company");
$where = '';
foreach ($company as $k=>$v){
if($k==0){
$where = " work_experience like '%".$v."%'";
}else{
$where = $where. " OR work_experience like '%".$v."%'";
$work_experience=UsersModel::where(['id'=>$this->auth->id])->value("work_experience");
if($work_experience){
$company=array_column(json_decode($work_experience), "company");
foreach ($company as $k=>$v){
if($k==0){
$where = " work_experience like '%".$v."%'";
}else{
$where = $where. " OR work_experience like '%".$v."%'";
}
}
}
}
......
......@@ -137,8 +137,8 @@ class Users extends Api
$userinfo['certification_fee'] = \think\Config::get('site.certification_fee');
//处理教育,工作字段
$userinfo['educational'] = json_decode($userinfo['educational']);
$userinfo['work_experience'] = json_decode($userinfo['work_experience']);
$userinfo['educational'] = $userinfo['educational']?json_decode($userinfo['educational']):'';
$userinfo['work_experience'] = $userinfo['work_experience']?json_decode($userinfo['work_experience']):'';
if($this->auth->village_id >0) {
$userinfo['addr_name']= Db::name("addr_village")->where(['village_code' => $this->auth->village_id])->field('province,city,county,town,village')->find();
}
......
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