From f58b93b06655882fafcd3d77fc4db1ce68671dba Mon Sep 17 00:00:00 2001
From: devil
Date: Wed, 29 Jul 2020 10:52:26 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
application/admin/form/Order.php | 42 ++++++++++++++++---
.../view/default/order/module/goods.html | 2 +-
application/index/form/Order.php | 7 +---
.../index/view/default/order/detail.html | 8 +---
.../view/default/order/module/goods.html | 2 +-
5 files changed, 43 insertions(+), 18 deletions(-)
diff --git a/application/admin/form/Order.php b/application/admin/form/Order.php
index d5ba0cae1..a5ec66729 100644
--- a/application/admin/form/Order.php
+++ b/application/admin/form/Order.php
@@ -63,7 +63,7 @@ class Order
'where_type' => 'like',
'where_type_custom' => 'in',
'where_handle_custom' => 'WhereBaseGoodsInfo',
- 'placeholder' => '请输入订单ID/订单号/仓库/商品名称/型号',
+ 'placeholder' => '请输入订单ID/订单号/商品名称/型号',
],
],
[
@@ -135,6 +135,20 @@ class Order
'is_point' => 1,
],
],
+ [
+ 'label' => '出货仓库',
+ 'view_type' => 'field',
+ 'view_key' => 'warehouse_name',
+ 'search_config' => [
+ 'form_type' => 'select',
+ 'form_name' => 'warehouse_id',
+ 'where_type' => 'in',
+ 'data' => $this->OrderWarehouseList(),
+ 'data_key' => 'id',
+ 'data_name' => 'name',
+ 'is_multiple' => 1,
+ ],
+ ],
[
'label' => '订单模式',
'view_type' => 'field',
@@ -374,6 +388,27 @@ class Order
];
}
+ /**
+ * 订单仓库列表
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2020-07-29
+ * @desc description
+ */
+ public function OrderWarehouseList()
+ {
+ $data = [];
+ $wids = Db::name('Order')->column('warehouse_id');
+ if(!empty($wids))
+ {
+ $where = ['id'=>$wids];
+ $order_by = 'level desc, id desc';
+ $data = Db::name('Warehouse')->field('id,name')->where($where)->order($order_by)->select();
+ }
+ return $data;
+ }
+
/**
* 取货码条件处理
* @author Devil
@@ -457,11 +492,8 @@ class Order
{
if(!empty($value))
{
- // 仓库
- $wids = Db::name('Warehouse')->where('name', 'like', '%'.$value.'%')->column('id');
-
// 订单ID、订单号
- $ids = Db::name('Order')->where(['id|order_no'=>$value])->whereOr(['warehouse_id'=>$wids])->column('id');
+ $ids = Db::name('Order')->where(['id|order_no'=>$value])->column('id');
// 获取订单详情搜索的订单 id
if(empty($ids))
diff --git a/application/admin/view/default/order/module/goods.html b/application/admin/view/default/order/module/goods.html
index e79a8745c..f41ee54f8 100644
--- a/application/admin/view/default/order/module/goods.html
+++ b/application/admin/view/default/order/module/goods.html
@@ -4,7 +4,7 @@
{{$module_data.order_no}}
{{$module_data.id}}
{{if !empty($module_data['warehouse_name'])}}
- {{$module_data.warehouse_name}}
+ {{$module_data.warehouse_name}}
{{/if}}
diff --git a/application/index/form/Order.php b/application/index/form/Order.php
index 5f5fd8cbd..7be268546 100644
--- a/application/index/form/Order.php
+++ b/application/index/form/Order.php
@@ -91,7 +91,7 @@ class Order
'where_type' => 'like',
'where_type_custom' => 'in',
'where_handle_custom' => 'WhereBaseGoodsInfo',
- 'placeholder' => '请输入订单号/仓库/商品名称/型号',
+ 'placeholder' => '请输入订单号/商品名称/型号',
],
],
[
@@ -441,11 +441,8 @@ class Order
{
if(!empty($value))
{
- // 仓库
- $wids = Db::name('Warehouse')->where('name', 'like', '%'.$value.'%')->column('id');
-
// 订单号
- $ids = Db::name('Order')->where(['order_no'=>$value])->whereOr(['warehouse_id'=>$wids])->column('id');
+ $ids = Db::name('Order')->where(['order_no'=>$value])->column('id');
// 获取订单详情搜索的订单 id
if(empty($ids))
diff --git a/application/index/view/default/order/detail.html b/application/index/view/default/order/detail.html
index f2a269df8..1630e2c78 100755
--- a/application/index/view/default/order/detail.html
+++ b/application/index/view/default/order/detail.html
@@ -96,16 +96,12 @@
{{if !empty($data['warehouse_name'])}}
出货仓库:
-
- {{$data.warehouse_name}}
-
+
{{$data.warehouse_name}}
{{/if}}
订单模式:
-
- {{$data.order_model_name}}
-
+
{{$data.order_model_name}}
订单编号:
diff --git a/application/index/view/default/order/module/goods.html b/application/index/view/default/order/module/goods.html
index 7a1969a6f..551050120 100644
--- a/application/index/view/default/order/module/goods.html
+++ b/application/index/view/default/order/module/goods.html
@@ -3,7 +3,7 @@
{{$module_data.order_no}}
{{if !empty($module_data['warehouse_name'])}}
- {{$module_data.warehouse_name}}
+ {{$module_data.warehouse_name}}
{{/if}}