Преглед изворни кода

Merge branch 'zzd' of ssh://was.baoshi56.com:10022/var/git/bswas into LD

 Conflicts:
	resources/views/maintenance/feature/menu.blade.php
LD пре 5 година
родитељ
комит
7f212d01a8

+ 18 - 18
app/Services/FeatureService.php

@@ -242,7 +242,24 @@ Class FeatureService
                 $column = $features[$str]["type"];
                 $logic = $features[$str]["logic"];
                 $describe = $features[$str]["describe"];
-                if (($column == '商品名称' || $column == '订单数') && $isMultiMatching){
+                if ($column == '订单数'){
+                    $sum = 0;
+                    switch ($logic) {
+                        case "大于":
+                            if ($sum > $describe) return 'true';
+                            break;
+                        case "大于等于":
+                            if ($sum >= $describe) return 'true';
+                            break;
+                        case "小于":
+                            if ($sum < $describe) return 'true';
+                            break;
+                        case "小于等于":
+                            if ($sum <= $describe) return 'true';
+                            break;
+                    }
+                }
+                if ($column == '商品名称' && $isMultiMatching){
                     $packageColumn = $columnMapping["packages"] ?? "packages";
                     $packages = $matchObject[$packageColumn] ?? [];
                     $str = $this->multiMatching($packages,$logic,$describe,$columnMapping[$column] ?? '');
@@ -289,7 +306,6 @@ Class FeatureService
     {
         if(!$column)return 'false';
 
-        $sum = 0;
         foreach ($packages as $package){
             $value = $package[$column] ?? '';
             switch ($logic) {
@@ -302,24 +318,8 @@ Class FeatureService
                 case "等于":
                     if ($value == $describe)return 'true';
                     break;
-                default:
-                    $sum += $value;
             }
         }
-        switch ($logic) {
-            case "大于":
-                if ($sum > $describe) return 'true';
-                break;
-            case "大于等于":
-                if ($sum >= $describe) return 'true';
-                break;
-            case "小于":
-                if ($sum < $describe) return 'true';
-                break;
-            case "小于等于":
-                if ($sum <= $describe) return 'true';
-                break;
-        }
         return "false";
     }
 

+ 1 - 1
app/Services/OrderService.php

@@ -1060,7 +1060,7 @@ class OrderService
 
        if (app("OwnerFeeDetailService")->create([
             "owner_id"          => $order->owner_id,
-            "worked_at"         => $order->wms_edittime,
+            "worked_at"         => $order->wms_edittime ?? $order->updated_at,
             "type"              => "发货",
             "shop_id"           => $order->shop_id,
             "operation_bill"    => $order->code,

+ 1 - 0
app/Services/OwnerPriceOperationService.php

@@ -162,6 +162,7 @@ Class OwnerPriceOperationService
             return -7;
         }*/
         foreach ($rules as $rule){
+
             if (!$rule->items)continue;
             if ($rule->strategy == '特征'){
                 $bool = app("FeatureService")->matchFeature($rule->feature,$columnMapping,$matchObject);

+ 1 - 1
database/migrations/2021_01_25_104626_create_order_package_counting_records_table.php

@@ -14,7 +14,7 @@ class CreateOrderPackageCountingRecordsTable extends Migration
     public function up()
     {
         Schema::create('order_package_counting_records', function (Blueprint $table) {
-            $table->date("targeted_at")->index()->comment("统计日期");
+            $table->date("targeted_at")->primary()->comment("统计日期");
             $table->integer("un_weigh_count")->default(0)->comment("未称重数量");
             $table->integer("total_count")->default(0)->comment("总数");
         });

+ 12 - 4
database/migrations/2021_01_27_174543_add_column_owner_price_model_storage.php

@@ -17,8 +17,12 @@ class AddColumnOwnerPriceModelStorage extends Migration
         Schema::table('owner_storage_price_models', function (Blueprint $table) {
             $table->bigInteger("time_unit_id")->comment("计时单位");
         });
-        DB::statement("ALTER TABLE features MODIFY COLUMN type enum ('商品名称','订单类型','承运商','店铺类型','订单数') default null");
-        DB::statement("ALTER TABLE features MODIFY COLUMN logic enum ('包含','不包含','等于','大于','大于等于','小于','小于等于') default null");
+        Schema::table("owner_price_model_operations",function (Blueprint $table){
+            $table->decimal("discount_count")->nullable()->comment("减免数");
+        });
+        Schema::table("owner_price_model_operation_items",function (Blueprint $table){
+            $table->decimal("discount_price")->nullable()->comment("减免单价");
+        });
     }
 
     /**
@@ -31,7 +35,11 @@ class AddColumnOwnerPriceModelStorage extends Migration
         Schema::table('owner_storage_price_models', function (Blueprint $table) {
             $table->dropColumn("time_unit_id");
         });
-        DB::statement("ALTER TABLE features MODIFY COLUMN type enum ('商品名称','订单类型','承运商','店铺类型') default null");
-        DB::statement("ALTER TABLE features MODIFY COLUMN logic enum ('包含','不包含','等于') default null");
+        Schema::table("owner_price_model_operations",function (Blueprint $table){
+            $table->dropColumn("discount_count");
+        });
+        Schema::table("owner_price_model_operation_items",function (Blueprint $table){
+            $table->dropColumn("discount_price");
+        });
     }
 }

+ 2 - 2
resources/views/customer/project/create.blade.php

@@ -176,8 +176,8 @@
                     discount_type:[
                         "无减免","按单减免","固定减免"
                     ],
-                    feature_type:['商品名称','订单类型','承运商','店铺类型'],
-                    logic : ['包含','不包含','等于'],
+                    feature_type:['商品名称','订单类型','承运商','店铺类型','订单数'],
+                    logic : ['包含','不包含','等于','大于','大于等于','小于','小于等于'],
                 },
                 poolMapping:{},//基础数据选择池的映射对象 供展示使用
                 selectedModel:{//已选定的计费模型

+ 1 - 1
resources/views/customer/project/part/_storage.blade.php

@@ -46,7 +46,7 @@
         <label for="unit_id" class="col-5 offset-1 text-info">单位</label>
         <select id="unit_id" class="col-6 form-control"
                 :class="errors.unit_id ? 'is-invalid' : ''" v-model="model.storage.unit_id">
-            <option v-for="unit in pool.units" :value="unit.id">@{{ unit.name }}</option>
+            <option v-for="unit in pool.units" :value="unit.id" v-if="unit.name == 'm²' || unit.name == 'm³'">@{{ unit.name }}</option>
         </select>
         <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.unit_id">
             <strong>@{{ errors.unit_id[0] }}</strong>

+ 0 - 35
resources/views/maintenance/feature/create.blade.php

@@ -1,35 +0,0 @@
-@extends('layouts.app')
-@section('title')特征-录入@endsection
-
-@section('content')
-    <div id="nav2">
-        @component('maintenance.menu')@endcomponent
-        @component('maintenance.feature.menu')@endcomponent
-    </div>
-    <div class="container-fluid card">
-        <div class="card-body offset-3 mt-2">
-            <form method="post" action="{{url('')}}">
-                <div class="row">
-                    <label class="col-2" for="type">特征类型</label>
-                    <select class="form-control col-3" id="type" name="type">
-                        <option></option>
-                    </select>
-                </div>
-                <div class="row mt-3">
-                    <label class="col-2" for="logic">逻辑</label>
-                    <select class="form-control col-3" id="logic" name="logic">
-                        <option></option>
-                    </select>
-                </div>
-                <div class="row mt-3">
-                    <label class="col-2" for="describe">字段特征</label>
-                    <input class="form-control col-6" id="describe" name="describe">
-                </div>
-                <div class="row mt-3 offset-1">
-                    <button class="btn btn-success col-7">提交</button>
-                </div>
-            </form>
-        </div>
-    </div>
-@stop
-

+ 0 - 24
resources/views/maintenance/feature/index.blade.php

@@ -1,24 +0,0 @@
-@extends('layouts.app')
-@section('title')特征@endsection
-
-@section('content')
-    <div id="nav2">
-        @component('maintenance.menu')@endcomponent
-        @component('maintenance.feature.menu')@endcomponent
-    </div>
-    <div class="container-fluid card">
-        <div class="card-body mt-2">
-            <table class="table table-striped table-hover text-nowrap">
-                <tr>
-                    <th>ID</th>
-                    <th>类型</th>
-                    <th>逻辑</th>
-                    <th>特征</th>
-                    <th>创建时间</th>
-                    <th>操作</th>
-                </tr>
-            </table>
-        </div>
-    </div>
-@stop
-

+ 0 - 14
resources/views/maintenance/feature/menu.blade.php

@@ -1,14 +0,0 @@
-<div class="container-fluid nav3">
-    <div class="card menu-third" >
-        <ul class="nav nav-pills">
-            @can('特征-查询')
-            <li class="nav-item">
-                <a target="maintenance/feature" class="nav-link" href="{{url('maintenance/feature')}}" :class="{active:isActive('',3)}">查询</a>
-            </li> @endcan
-            @can('特征-录入')
-            <li class="nav-item">
-                <a target="maintenance/feature/create" class="nav-link" href="{{url('maintenance/feature/create')}}" :class="{active:isActive('create',3)}">录入</a>
-            </li> @endcan
-        </ul>
-    </div>
-</div>

+ 2 - 2
resources/views/maintenance/priceModel/operation/create.blade.php

@@ -172,8 +172,8 @@
                     {id:"{{$unit->id}}",name:"{{$unit->name}}"},
                     @endforeach
                 ],
-                type : ['商品名称','订单类型','承运商','店铺类型'],
-                logic : ['包含','不包含','等于'],
+                type : ['商品名称','订单类型','承运商','店铺类型','订单数'],
+                logic : ['包含','不包含','等于','大于','大于等于','小于','小于等于'],
                 features : [],
                 thisIndex : "",
                 errors:{!! $errors !!},

+ 2 - 2
resources/views/maintenance/priceModel/operation/index.blade.php

@@ -149,8 +149,8 @@
                 items : [],
                 updateDetailId : '',
                 units : null,
-                type : ['商品名称','订单类型','承运商','店铺类型'],
-                logic : ['包含','不包含','等于'],
+                type : ['商品名称','订单类型','承运商','店铺类型','订单数'],
+                logic : ['包含','不包含','等于','大于','大于等于','小于','小于等于'],
                 item : {
                     "strategy" : '特征',
                     "amount" : "",