dyjh hace 6 años
padre
commit
7451e7441e

+ 3 - 3
app/Http/Controllers/Api/V1/AlbumController.php

xqd xqd xqd
@@ -240,7 +240,7 @@ class AlbumController extends Controller
                 $add['store_id'] = $datas['store_id'];
                 $res = AlbumUserModel::create($add);
                 if($res){
-                    $check = AlbumXyxUserModel::where('wechat_open_id',$res['openid'])->first();
+                    $check = AlbumUserModel::where('wechat_open_id',$res['openid'])->first();
                     $user = [
                         'user_id'=>$check['id'],
                         //'avatar'=>$check['avatar'],
@@ -260,7 +260,7 @@ class AlbumController extends Controller
                 $res = AlbumUserModel::where('wechat_open_id',$res['openid'])->update($save);
                 //echo 111;
                     //print_r($check);die;
-                    if($check->is_agent == 1){
+                    if($check->is_dealer == 1){
                         $user_agent = AlbumAgentModel::where('user_id',$check->id)->first();
                         $agent_id = $user_agent['id'];
                     } else {
@@ -271,7 +271,7 @@ class AlbumController extends Controller
                         'user_id'=>$check->id,
                         //'avatar'=>$datas['avatar'],
                         //'username'=>$datas['nickName'],
-                        'is_agent'=>$check->is_agent,
+                        'is_agent'=>$check->is_dealer,
                         'agent_id'=>$agent_id,
 
                     ];

+ 33 - 0
database/migrations/2018_10_29_175006_add_column_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 AddColumnToAlbumUser extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_user', function (Blueprint $table) {
+            //
+            $table->unsignedInteger('up_agent_id')->default(0)->comment('临时agentid');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_user', function (Blueprint $table) {
+            //
+        });
+    }
+}