浏览代码

项目管理 项目 客户 页面 自动填充修复

ajun 4 年之前
父节点
当前提交
c8a7587b7d

+ 2 - 2
app/Filters/OwnerSundryFeeDetailFilters.php

@@ -14,7 +14,7 @@ class OwnerSundryFeeDetailFilters
 {
     protected $request;
     protected $queryBuilder;
-    protected $filters = ['owner_id'];
+    protected $filters = ['owners'];
 
     public function __construct(Request $request)
     {
@@ -34,7 +34,7 @@ class OwnerSundryFeeDetailFilters
     }
 
 
-    private function owner_id($owner_id)
+    private function owners($owner_id)
     {
         if (strpos($owner_id, ',') || strpos($owner_id, ',') || strpos($owner_id, ' ')) {
             $arr = array_filter(preg_split('/[,, ]+/is', $owner_id));

+ 24 - 15
app/Services/OwnerService.php

@@ -252,6 +252,15 @@ class OwnerService
                 });
                 continue;
             }
+            if ($column == 'customers'){
+                if (is_array($param))$builder->whereIn('customer_id',$param);
+                else $builder->where('customer_id',$param);
+            }
+            if ($column == 'ids'){
+                if (is_array($param))$builder->whereIn('id',$param);
+                else $builder->where('id',$param);
+            }
+
             if (is_array($param))$builder->whereIn($column,$param);
             else $builder->where($column,$param);
         }
@@ -385,37 +394,37 @@ sql
     {
         $relevance = [];
         $sql = <<<sql
-SELECT 1 FROM owner_storage_price_models a 
-LEFT JOIN owner_storage_price_model_owner b ON a.id =  b.owner_storage_price_model_id 
-LEFT JOIN owners c ON b.owner_id = c.id 
+SELECT 1 FROM owner_storage_price_models a
+LEFT JOIN owner_storage_price_model_owner b ON a.id =  b.owner_storage_price_model_id
+LEFT JOIN owners c ON b.owner_id = c.id
 WHERE (a.operation IS NULL OR a.operation = '') AND c.id = ? LIMIT 1
 sql;
         if (DB::selectOne(DB::raw($sql),[$ownerId]))$relevance[] = 0;
         $sql = <<<sql
-SELECT 1 FROM owner_price_operations a 
-LEFT JOIN owner_price_operation_owner b ON a.id =  b.owner_price_operation_id 
-LEFT JOIN owners c ON b.owner_id = c.id 
+SELECT 1 FROM owner_price_operations a
+LEFT JOIN owner_price_operation_owner b ON a.id =  b.owner_price_operation_id
+LEFT JOIN owners c ON b.owner_id = c.id
 WHERE (a.operation IS NULL OR a.operation = '') AND c.id = ? LIMIT 1
 sql;
         if (DB::selectOne(DB::raw($sql),[$ownerId]))$relevance[] = 1;
         $sql = <<<sql
-SELECT 1 FROM owner_price_expresses a 
-LEFT JOIN owner_price_express_owner b ON a.id =  b.owner_price_express_id 
-LEFT JOIN owners c ON b.owner_id = c.id 
+SELECT 1 FROM owner_price_expresses a
+LEFT JOIN owner_price_express_owner b ON a.id =  b.owner_price_express_id
+LEFT JOIN owners c ON b.owner_id = c.id
 WHERE (a.operation IS NULL OR a.operation = '') AND c.id = ? LIMIT 1
 sql;
         if (DB::selectOne(DB::raw($sql),[$ownerId]))$relevance[] = 2;
         $sql = <<<sql
-SELECT 1 FROM owner_price_logistics a 
-LEFT JOIN owner_price_logistic_owner b ON a.id =  b.owner_price_logistic_id 
-LEFT JOIN owners c ON b.owner_id = c.id 
+SELECT 1 FROM owner_price_logistics a
+LEFT JOIN owner_price_logistic_owner b ON a.id =  b.owner_price_logistic_id
+LEFT JOIN owners c ON b.owner_id = c.id
 WHERE (a.operation IS NULL OR a.operation = '') AND c.id = ? LIMIT 1
 sql;
         if (DB::selectOne(DB::raw($sql),[$ownerId]))$relevance[] = 3;
         $sql = <<<sql
-SELECT 1 FROM owner_price_direct_logistics a 
-LEFT JOIN owner_price_direct_logistic_owner b ON a.id =  b.owner_price_direct_logistic_id 
-LEFT JOIN owners c ON b.owner_id = c.id 
+SELECT 1 FROM owner_price_direct_logistics a
+LEFT JOIN owner_price_direct_logistic_owner b ON a.id =  b.owner_price_direct_logistic_id
+LEFT JOIN owners c ON b.owner_id = c.id
 WHERE (a.operation IS NULL OR a.operation = '') AND c.id = ? LIMIT 1
 sql;
         if (DB::selectOne(DB::raw($sql),[$ownerId]))$relevance[] = 4;

+ 2 - 1
resources/views/customer/ownerSundryFee/index.blade.php

@@ -1,4 +1,5 @@
 @extends('layouts.app')
+
 @section('content')
     @include('shared._messages')
     @include('shared._error')
@@ -84,7 +85,7 @@
                 let data = [
                     [
                         {
-                            name: 'owner_id',
+                            name: 'owners',
                             type: 'select_multiple_select',
                             tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的客户'],
                             placeholder: ['货主', '定位或多选货主'],

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

@@ -140,11 +140,11 @@
                     [
                         {name:'user_owner_group_id',type:'select',tip:'项目小组',placeholder: '项目小组',data:this.ownerGroups},
                         {name:'created_at_start',type:'time',tip:['选择显示创建日期的起始时间','']},
-                        {name:'id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的项目'],
+                        {name:'ids',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的项目'],
                             placeholder:['项目','定位或多选项目'],data:this.models},
                         {name:'contract_number',type:'input',tip: '合同号:可在左侧增加百分号(%)进行模糊搜索',placeholder: '合同号'},
                     ],[
-                        {name:'customer_id',type:'select_multiple_select',tip:['客户','定位或多选项目'],placeholder: ['客户','定位或多选项目'],data:this.customers},
+                        {name:'customers',type:'select_multiple_select',tip:['客户','定位或多选项目'],placeholder: ['客户','定位或多选项目'],data:this.customers},
                         {name:'created_at_end',type:'time',tip:['选择显示创建日期的结束时间','']},
                         {name:'using_type',type:'select',placeholder: '用仓类型',data:[{name:"常温",value:"常温"},{name:"恒温",value:"恒温"}]},
                     ],