提交 f58b93b0 编写于 作者: D devil

订单优化

上级 9f9dcfb3
...@@ -63,7 +63,7 @@ class Order ...@@ -63,7 +63,7 @@ class Order
'where_type' => 'like', 'where_type' => 'like',
'where_type_custom' => 'in', 'where_type_custom' => 'in',
'where_handle_custom' => 'WhereBaseGoodsInfo', 'where_handle_custom' => 'WhereBaseGoodsInfo',
'placeholder' => '请输入订单ID/订单号/仓库/商品名称/型号', 'placeholder' => '请输入订单ID/订单号/商品名称/型号',
], ],
], ],
[ [
...@@ -135,6 +135,20 @@ class Order ...@@ -135,6 +135,20 @@ class Order
'is_point' => 1, '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' => '订单模式', 'label' => '订单模式',
'view_type' => 'field', 'view_type' => 'field',
...@@ -374,6 +388,27 @@ class Order ...@@ -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 * @author Devil
...@@ -457,11 +492,8 @@ class Order ...@@ -457,11 +492,8 @@ class Order
{ {
if(!empty($value)) if(!empty($value))
{ {
// 仓库
$wids = Db::name('Warehouse')->where('name', 'like', '%'.$value.'%')->column('id');
// 订单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 // 获取订单详情搜索的订单 id
if(empty($ids)) if(empty($ids))
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<strong class="am-icon-bookmark-o"> {{$module_data.order_no}}</strong> <strong class="am-icon-bookmark-o"> {{$module_data.order_no}}</strong>
<strong class="am-icon-circle-thin am-margin-left-lg"> {{$module_data.id}}</strong> <strong class="am-icon-circle-thin am-margin-left-lg"> {{$module_data.id}}</strong>
{{if !empty($module_data['warehouse_name'])}} {{if !empty($module_data['warehouse_name'])}}
<span class="am-badge am-badge-secondary-plain am-radius am-fr">{{$module_data.warehouse_name}}</span> <span class="am-icon-map-marker am-fr"> {{$module_data.warehouse_name}}</span>
{{/if}} {{/if}}
</p> </p>
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-top-0" /> <hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-top-0" />
......
...@@ -91,7 +91,7 @@ class Order ...@@ -91,7 +91,7 @@ class Order
'where_type' => 'like', 'where_type' => 'like',
'where_type_custom' => 'in', 'where_type_custom' => 'in',
'where_handle_custom' => 'WhereBaseGoodsInfo', 'where_handle_custom' => 'WhereBaseGoodsInfo',
'placeholder' => '请输入订单号/仓库/商品名称/型号', 'placeholder' => '请输入订单号/商品名称/型号',
], ],
], ],
[ [
...@@ -441,11 +441,8 @@ class Order ...@@ -441,11 +441,8 @@ class Order
{ {
if(!empty($value)) 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 // 获取订单详情搜索的订单 id
if(empty($ids)) if(empty($ids))
......
...@@ -96,16 +96,12 @@ ...@@ -96,16 +96,12 @@
{{if !empty($data['warehouse_name'])}} {{if !empty($data['warehouse_name'])}}
<div class="items am-cf"> <div class="items am-cf">
<div class="items-title am-fl">出货仓库:</div> <div class="items-title am-fl">出货仓库:</div>
<div class="items-detail am-fl"> <div class="items-detail am-fl">{{$data.warehouse_name}}</div>
<span class="am-badge am-badge-secondary-plain am-radius">{{$data.warehouse_name}}</span>
</div>
</div> </div>
{{/if}} {{/if}}
<div class="items am-cf"> <div class="items am-cf">
<div class="items-title am-fl">订单模式:</div> <div class="items-title am-fl">订单模式:</div>
<div class="items-detail am-fl"> <div class="items-detail am-fl">{{$data.order_model_name}}</div>
<span class="am-badge am-badge-secondary-plain am-radius">{{$data.order_model_name}}</span>
</div>
</div> </div>
<div class="items am-cf"> <div class="items am-cf">
<div class="items-title am-fl">订单编号:</div> <div class="items-title am-fl">订单编号:</div>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<p class="am-margin-bottom-sm"> <p class="am-margin-bottom-sm">
<strong class="am-icon-bookmark-o"> {{$module_data.order_no}}</strong> <strong class="am-icon-bookmark-o"> {{$module_data.order_no}}</strong>
{{if !empty($module_data['warehouse_name'])}} {{if !empty($module_data['warehouse_name'])}}
<span class="am-badge am-badge-secondary-plain am-radius am-fr">{{$module_data.warehouse_name}}</span> <span class="am-icon-map-marker am-fr"> {{$module_data.warehouse_name}}</span>
{{/if}} {{/if}}
</p> </p>
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-top-0" /> <hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-top-0" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册