xxxrrrdddd před 2 roky
rodič
revize
f4dd70d6f3

+ 4 - 0
application/admin/controller/Mobile.php

@@ -741,4 +741,8 @@ class Mobile extends Backend
             $this->result(['num'=>$num],1);
         }
     }
+
+    public function mobile_rules(){
+        return MobileConstant::getRuleKeys();
+    }
 }

+ 26 - 0
application/common/model/MobileOrder.php

@@ -4,6 +4,7 @@ namespace app\common\model;
 
 use app\admin\model\Admin;
 use app\admin\model\MobileOrderAdmin;
+use app\common\library\MobileConstant;
 use app\common\service\Refund;
 use app\common\service\SmsSend;
 use think\Db;
@@ -98,6 +99,9 @@ class MobileOrder extends Model
     public function refundLog(){
         return $this->hasMany(MobileOrderRefundLog::class);
     }
+    public function rules(){
+        return $this->hasMany(MobileOrderRules::class);
+    }
     public function proxy(){
         $columns=Admin::getTableInfo()['fields'];
         unset($columns['password']);
@@ -114,6 +118,26 @@ class MobileOrder extends Model
         return $a;
     }
 
+    public function saveRules(){
+        if($this['type']==1) {
+            $mobile=$this['mobile'];
+            $filters=MobileConstant::getFilters();
+            $rules=[];
+            foreach ($filters as $rule=>$filter){
+                $fit=false;
+                foreach ($filter as $column){
+                    if($mobile[$column]){
+                        $fit=true;
+                        break;
+                    }
+                }
+                if($fit){
+                    $rules[]=$rule;
+                }
+            }
+            $this->rules()->saveAll($rules);
+        }
+    }
 
     protected static function init()
     {
@@ -130,6 +154,8 @@ class MobileOrder extends Model
                 'mobile'=>$mobileOrder['mobile'],
                 'info'=>$mobileOrder['mobile']['info'],
             ]);
+            #保存规律
+            $mobileOrder->saveRules();
         });
 
         self::beforeUpdate(function (self $mobileOrder){

+ 13 - 0
application/common/model/MobileOrderRules.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace app\common\model;
+
+use think\Model;
+use Yansongda\Supports\Str;
+
+/**
+ * 配置模型
+ */
+class MobileOrderRules extends Model
+{
+}

+ 9 - 4
public/assets/js/backend/mobile_order.js

@@ -31,6 +31,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','clipboard'],
 
             let status = await $.getJSON('mobile_order/status')
             let payType = await $.getJSON('mobile_order/pay_type')
+            let mobileRules = await $.getJSON('mobile/mobile_rules')
             table.on('load-success.bs.table', function (_, data) {
                 let e=data.extend;
                 $('#orderAmount').html(`收入:${e.total}支付宝:${e.alipay}微信:${e.wechat}京东:${e.jd}成本:${e.di}利润:${e.profit}退款:${e.refund}`)
@@ -61,6 +62,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','clipboard'],
                         {field: 'order_no', title: __('订单号'),visible:false,operate: 'like'},
                         {field: 's_id', title: __('来源渠道')},
                         {field: 'pay_type', title: __('支付方式'),searchList: payType,visible: false},
+                        {field: 'pay_mid_wechat', title: __('微信商户号'),visible: false,operate: 'LIKE'},
+                        {field: 'pay_mid_alipay', title: __('支付宝商户号'),visible: false,operate: 'LIKE'},
+                        {field: 'name', title: __('收货人'),visible: false,operate: 'LIKE'},
+                        {field: 'phone', title: __('收货人手机'),visible: false,operate: 'LIKE'},
+                        {field: 'no', title: __('手机号'),visible: false,operate: 'LIKE'},
                         {field: 'order_no', title: __('订单信息'),operate: false,formatter(_,order){
                             let a=[]
                                 a.push(`<div>订单号:${order.order_no}</div>`)
@@ -89,6 +95,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','clipboard'],
                                 return `<div style="max-width: 200px;text-align: left;" class="break-words">${a.join('')}</div>`
                             },width:200,valign:'top',align:'left'},
                         {field: 'status', title: __('Status'),formatter: Table.api.formatter.label,searchList:status},
+                        {field: 'rule', title: __('类型'),visible: false,searchList:mobileRules},
                         {field: 'remark_backend', title: __('备注'),formatter: Table.api.formatter.content,operate:false,align: 'left',valign: 'top'},
                         //{field: 'remark_sub', title: __('分站备注'),formatter: Table.api.formatter.content,operate:false},
                         {field: '', title: __('退款记录'),formatter(_,order){
@@ -140,10 +147,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','clipboard'],
                         {field: 'open_name', title: __('开卡人姓名')},
                         {field: 'open_id_no', title: __('开卡人身份证号码')},
                         {field: 'open_phone', title: __('开卡人手机号')},*/
-                        {field: 'trans_no', title: __('Trans_no'),visible: false},
-                        {field: 'phone', title: __('收货人手机'),visible: false},
-                        {field: 'name', title: __('收货人姓名'),visible: false},
-                        {field: 'id_no', title: __('收货人身份证'),visible: false},
+                        {field: 'trans_no', title: __('Trans_no'),visible: false,operate: "like"},
+                        {field: 'id_no', title: __('收货人身份证'),visible: false,operate: "like"},
                         {
                             field: 'operate',
                             title: __('Operate'),