diff --git a/application/admin/form/Order.php b/application/admin/form/Order.php index d5ba0cae10ea92c94496ab39b26513f31b8090f6..a5ec667292d579c8f76c3a67a5ec94cd0f1d9e77 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 e79a8745cee916e5fababc06e761d49ac28573e2..f41ee54f818cbb7a15f1b02bc8c14ad9adbc97dc 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 5f5fd8cbd3caa9650153eac0ee54fd992cb88d3e..7be2685464c072d04998b27297ffb1318bd8c021 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 f2a269df87fd4e1292f3baee8896193cd9b70e74..1630e2c78a0afca7c981cb4eb626619209700ec3 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 7a1969a6f18e0c1b2be78baf49e3574ce3bd18f3..551050120b1e6a777b0a1ef47307b16597fd50cf 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}}