chenhao 4 年之前
父节点
当前提交
83f9b731ca
共有 2 个文件被更改,包括 10 次插入3 次删除
  1. 3 2
      application/api/controller/User.php
  2. 7 1
      application/common/model/OfficeModel.php

+ 3 - 2
application/api/controller/User.php

@@ -522,10 +522,11 @@ class User extends Api
 
         $isset = Db::name('user_qiye')->where('uid',$user['id'])->find();
 
-        $data['avatar_image'] = config('site.httpurl').'/assets/img/qrcode.png';
+        if(!isset($data['avatar_image']) || empty($data['avatar_image'])) $data['avatar_image'] = config('site.httpurl').'/assets/img/qrcode.png';
 
         if ($isset) {
-            return $this->error('您的审核已经提交过了');
+            Db::name('user_qiye')->where('id',$isset['$id'])->update($data);
+            return $this->error('操作成功');
         }
         $data['uid'] = $user['id'];
 

+ 7 - 1
application/common/model/OfficeModel.php

@@ -35,7 +35,13 @@ class OfficeModel extends Model
     }
     public function getBannerImagesAttr($value)
     {
-        return explode(',',$value);
+        $data = explode(',',$value);
+
+        foreach ($data as $k=>$n) {
+            $data[$k] = config('site.httpurl').$data[$k];
+        }
+
+        return $data;
     }
     public function getImagesAttr($value)
     {