qifengquan 1 year ago
parent
commit
4211f9fc9b

+ 11 - 1
application/api/controller/User.php

@@ -16,6 +16,7 @@ use app\common\model\Like;
 use app\common\model\MoneyLog;
 use app\common\model\Order;
 use app\common\model\Selection;
+use app\common\model\Shield;
 use app\common\model\SystemMessages;
 use app\common\model\UserObject;
 use app\common\model\WorkAuthentication;
@@ -227,7 +228,7 @@ class User extends Api
         if ($ret) {
             Sms::flush($mobile, 'mobilelogin');
             $data = ['userinfo' => $this->auth->getUserinfo()];
-            $data['openid'] = (new \app\api\controller\Common())->getOpenid($code);
+//            $data['openid'] = (new \app\api\controller\Common())->getOpenid($code);
             $this->success(__('Logged in successful'), $data);
         } else {
             $this->error($this->auth->getError());
@@ -951,4 +952,13 @@ class User extends Api
         $user->save(['status'=>'destruction','reason_cancellation'=>$reason_cancellation]);
         $this->success('注销成功');
     }
+
+    /**
+     * 屏蔽列表
+     * @ApiMethod (POST)
+     */
+    public function shield(){
+        $this->success('',Shield::all(['uid'=>$this->auth->id],['userinfo.areaCity']));
+    }
+
 }

+ 4 - 0
application/common/model/Shield.php

@@ -27,4 +27,8 @@ class Shield extends Model
 
     ];
 
+    public function userinfo(){
+        return $this->belongsTo('User','nid','id',[],'LEFT')->field('id,username,avatar,max_income,region_city,birthday');
+    }
+
 }

+ 8 - 1
application/common/model/User.php

@@ -181,7 +181,14 @@ class User extends Model
     /**
      * area
      */
-    public function area_province(){
+    public function areaProvince(){
         return $this->belongsTo('Area','province','id','','LEFT');
     }
+
+    /**
+     * area
+     */
+    public function areaCity(){
+        return $this->belongsTo('Area','region_city','id','','LEFT');
+    }
 }

File diff suppressed because it is too large
+ 297 - 180
public/api.html


Some files were not shown because too many files changed in this diff