dyjh преди 6 години
родител
ревизия
37d8ee1b25

+ 2 - 0
app/Http/Controllers/Api/V1/AlbumController.php

xqd xqd
@@ -241,6 +241,7 @@ class AlbumController extends Controller
                 $add['wechat_union_id'] = '';
                 $add['avatar'] = $datas['avatar'];
                 $add['is_agent'] = 0;
+                $add['model'] = 1;
                 $add['store_id'] = $datas['store_id'];
                 $res = AlbumUserModel::create($add);
                 if($res){
@@ -262,6 +263,7 @@ class AlbumController extends Controller
                 //print_r($check);die;
                 $save['username'] = preg_replace('/[\xf0-\xf7].{3}/', '', $datas['nickName']);
                 $save['avatar'] = $datas['avatar'];
+                $save['model'] = 1;
                 $res = AlbumUserModel::where('wechat_open_id',$res['openid'])->update($save);
                 //echo 111;
                     //print_r($check);die;

+ 1 - 0
app/Models/AdminUserModel.php

xqd
@@ -40,6 +40,7 @@ class AdminUserModel extends Authenticatable
         'last_login_time',
         'status',
         'is_root',
+        'model',
         'admin_role_id'
     ];
 

+ 33 - 0
database/migrations/2018_12_06_145438_edit_column_model_to_album_user.php

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class EditColumnModelToAlbumUser extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_user', function (Blueprint $table) {
+            //
+            $table->unsignedInteger('model')->default(0)->comment('用戶所屬模塊 0 家具 1画册');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_user', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 2 - 2
resources/views/admin/album/user/index.blade.php

xqd xqd
@@ -51,7 +51,7 @@
                                         <td>{{ $item->username }}</td>
                                         <td><img src="{{ $item->avatar }}"/></td>
                                         <td>{{ $item->phone }}</td>
-                                        @if($item['is_dealer'] == 1)
+                                        @if($item['is_dealer'] == 1&&$item['model']==1)
                                             <td>经销商</td>
                                         @else
                                             <td>普通用户</td>
@@ -59,7 +59,7 @@
                                         <td>{{ $item->created_at }}</td>
                                         <td>{{ $item->role() }}</td>
                                         <td>
-                                            @if(!$item->is_dealer)
+                                            @if(!$item->is_dealer && $item['model']==1)
                                                 <button onclick="window.location.href='{{ U('Album/User/update',['id'=>$item->id]) }}'"
                                                         class="btn btn-warning">添加经销商
                                                 </button>