Просмотр исходного кода

去掉了api_token字段(使用token模型,微信的接口调过但可能被覆盖了)
调了一下migration时可能会出错的表
统一了一下weight的路由

LD 6 лет назад
Родитель
Сommit
97109d4ffc

+ 0 - 1
app/Http/Controllers/Auth/RegisterController.php

@@ -71,7 +71,6 @@ class RegisterController extends Controller
             'name' => $data['name'],
             'email' => $data['email'],
             'password' => Hash::make($data['password']),
-            'api_token' => Str::random(60),
         ]);
     }
     public function register(Request $request)

+ 0 - 19
app/Http/Controllers/Controller.php

@@ -30,23 +30,4 @@ class Controller extends BaseController
         return ['success'=>'false','fail_info'=>$description];
     }
 
-    /**
-     * @return User
-     */
-    public function preparativeUser(){
-        $name='_preparativeUser_';
-        $user=User::where('name',$name)->first();
-        if(!$user){
-            $user = new User([
-                'name' => $name,
-                'email' =>  $name.'@'.$name.'.com',
-                'email_verified_at' => now(),
-                'password' => '$2y$10$vvcID/Akq2KjOZwRUUgBJOpVyGi.nTDT8Yb7gxiy5Xj9/5GnpzBMi', // password
-                'api_token' => md5($name),
-                'remember_token' => Str::random(10),
-            ]);
-            $user->save();
-        }
-        return $user;
-    }
 }

+ 1 - 1
app/User.php

@@ -22,7 +22,7 @@ class User extends Authenticatable
      * @var array
      */
     protected $fillable = [
-        'name', 'email', 'password', 'api_token'
+        'name', 'email', 'password'
     ];
 
     /**

+ 1 - 1
database/migrations/2019_11_22_094024_create_waybills_table.php

@@ -16,7 +16,7 @@ class CreateWaybillsTable extends Migration
         Schema::create('waybills', function (Blueprint $table) {
             $table->bigIncrements('id');
             $table->timestamps();
-            $table->string('state',20)->nullable()->comment('类型');
+            $table->enum('status',['未审核','已审核','待重审','待终审','已完结','无模型'])->default('未审核')->index()->comment('状态');
             $table->enum('type',['直发车','专线'])->comment('类型');
             $table->string('waybill_number',50)->unique()->index()->comment('运单号');
             $table->bigInteger('owner_id')->index()->comment('货主');

+ 0 - 34
database/migrations/2020_01_02_102517_change_waybill_status.php

@@ -1,34 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class ChangeWaybillStatus extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::table('waybills', function (Blueprint $table) {
-            $table->dropColumn('state');
-            $table->enum('status',['未审核','已审核','待重审','待终审','已完结','无模型'])->default('未审核')->index()->comment('状态');
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::table('waybills', function (Blueprint $table) {
-            $table->dropColumn('status');
-            $table->string('state',20)->nullable()->comment('状态');
-        });
-    }
-}

+ 3 - 2
database/migrations/2020_02_09_080123_add_weigh_excepted_authority.php

@@ -14,8 +14,9 @@ class AddWeighExceptedAuthority extends Migration
      */
     public function up()
     {
-        (new Authority(['name'=>'包裹信息-查看异常','alias_name'=>'包裹信息-查看异常']))->save();
-        (new Authority(['name'=>'包裹信息-录入','alias_name'=>'包裹信息-查看异常']))->save();
+
+        if(!Authority::where('name','包裹信息-查看异常')->first())(new Authority(['name'=>'包裹信息-查看异常','alias_name'=>'包裹信息-查看异常']))->save();
+        if(!Authority::where('name','包裹信息-录入')->first())(new Authority(['name'=>'包裹信息-录入','alias_name'=>'包裹信息-查看异常']))->save();
     }
 
     /**

+ 1 - 1
routes/api/thirdPart/weight.php

@@ -10,4 +10,4 @@ use Illuminate\Http\Request;
 //Route::post('new', "PackageController@new_");//增加新波次消息
 //accomplishToWMS() 发往WMS的完成单
 
-Route::post('receive/new','PackageController@new_');
+Route::post('new','PackageController@new_');