Pārlūkot izejas kodu

Merge branch 'develop'

zhangchangchun 5 gadi atpakaļ
vecāks
revīzija
7c13d3b9f4

+ 7 - 7
app/Http/Controllers/V1/ShopController.php

@@ -36,26 +36,26 @@ class ShopController extends Controller {
     {
         $data = $request->all();
         $validator = Validator::make($data, [
-            'shop_name' => 'required|max:11',
-            'shop_short_name' => 'required|string|max:100',
+            'shop_name' => 'required|max:50',
+            'shop_short_name' => 'required|string|max:50',
             'mobile' => 'required|max:11',
-            'address' => 'required|string',
+            'address' => 'required|string|max:50',
             'province_name' => 'required|string|max:50',
             'province_id' => 'required|integer|digits_between:1,7',
             'city_name' => 'required|string:max:50',
             'city_id' => 'required|integer|digits_between:1,7',
             'contact_name' => 'string|max:50',
             'contact_mobile' => 'max:16',
-            'shop_desc' => 'string|max:500',
+            'shop_desc' => 'string|max:100',
             'status' =>['required',Rule::in([0,1])],
             'logo_img' => 'string',
             'license_img' => 'required|string',
             'food_trans_license' => 'required|string',
             'other_license' => 'string',
-            'proportion'=>'required|digits_between:0,100',
+            'proportion'=>'required|between:0,100',
             'verify_type'=>['required',Rule::in([0,1])],
-            'account'=>'string|max:20',
-            'password'=>'string|min:6|max:18',
+            'account'=>'string|max:16',
+            'password'=>'string|min:6|max:16',
 //            'shop_id'=>'integer',
 //            'shop_account_id'=>'integer',
         ]);

+ 1 - 1
app/Repositories/ShopRepository.php

@@ -72,7 +72,7 @@ class ShopRepository {
         try{
             $shop = Shop::where(['shop_id'=>$shop_id])->update($data);
             $accountData = [];
-            if(isset($account) && isset($password)){
+            if(!empty($account) && !empty($password)){
                 $accountData['shop_id'] = $shop_id;
                 $accountData['account'] = $account;
                 $accountData['password'] = Hash::make($password);

+ 1 - 0
composer.json

@@ -7,6 +7,7 @@
     "require": {
         "php": ">=7.1.3",
         "dingo/api": "^2.2",
+        "doctrine/dbal": "^2.9",
         "guzzlehttp/guzzle": "^6.3",
         "cviebrock/laravel-elasticsearch": "^3.5",
         "hhxsv5/laravel-s": "~3.4.0",

+ 30 - 0
database/migrations/2019_06_05_101338_update_shop_table.php

@@ -0,0 +1,30 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class UpdateShopTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('shop', function (Blueprint $table) {
+            $table->decimal('proportion',4)->change();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+    }
+}