Explorar o código

修改信息提交

DESKTOP-2STQMTS\Administrator hai 1 ano
pai
achega
7f9f2c1440

+ 1 - 1
app/Http/Controllers/AdminApi/ApplyController.php

@@ -26,7 +26,7 @@ class ApplyController extends AdminController
                     $q->orWhere('s.phone','like',"%$search%");
                 }
             })
-            ->select(['s.id','s.name','s.phone','s.industry','s.created_at','u.name as s_name'])
+            ->select(['s.id','s.name','s.phone','s.industry','s.address','s.created_at','u.name as s_name'])
             ->orderBy('id','desc')
             ->paginate(10);
 

+ 5 - 1
app/Http/Controllers/Api/UserController.php

@@ -210,6 +210,7 @@ class UserController extends FrontController
         $name = request()->input('name', '');//名称
         $phone = request()->input('phone', '');//账号
         $industry = request()->input('industry', '');//行业
+        $address = request()->input('address', '');//地址
         $token = request()->input('token', '');//token
         if(empty($m_id) || empty($token)) return $this->apiResponseError('',[],401);
         $check = $this->checkLogin($m_id,$token);
@@ -219,8 +220,10 @@ class UserController extends FrontController
 
         if (empty($name))  return $this->apiResponseError( '名称必填');
         if (mb_strlen($name) > 10) return $this->apiResponseError('名称10字以内');
+        if (empty($industry)) return $this->apiResponseError('行业必填');
+        if (mb_strlen($industry) > 100) return $this->apiResponseError('行业信息过长');
 
-        if (!empty($industry) && mb_strlen($industry) > 100) return $this->apiResponseError('行业信息过长');
+        if (empty($address)) return $this->apiResponseError('地址必填');
 
         if (empty($phone))  return $this->apiResponseError( '手机号必填');
         if (!CommonServer::creatServer()->verifyPhoneNumber($phone)) {
@@ -241,6 +244,7 @@ class UserController extends FrontController
             'name' => $name,
             'phone' => $phone,
             'industry' => $industry,
+            'address' => $address,
         ]);
 
         if($res){