提交 42a00f24 编写于 作者: D devil

订单列表优化

上级 2e8825e8
...@@ -98,12 +98,12 @@ class Goods extends Common ...@@ -98,12 +98,12 @@ class Goods extends Common
]; ];
// 获取列表 // 获取列表
$data_params = array( $data_params = [
'm' => 0, 'm' => 0,
'n' => 1, 'n' => 1,
'where' => $where, 'where' => $where,
'is_category' => 1, 'is_category' => 1,
); ];
$ret = GoodsService::GoodsList($data_params); $ret = GoodsService::GoodsList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0]; $data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
$this->assign('data', $data); $this->assign('data', $data);
......
...@@ -51,52 +51,28 @@ class Order extends Common ...@@ -51,52 +51,28 @@ class Order extends Common
*/ */
public function Index() public function Index()
{ {
// 参数 // 总数
$params = input(); $total = OrderService::OrderTotal($this->form_where);
$params['user_type'] = 'admin';
// 分页
$number = MyC('admin_page_number', 10, true);
// 条件
$where = OrderService::OrderListWhere($params);
// 获取总数
$total = OrderService::OrderTotal($where);
// 分页 // 分页
$page_params = array( $page_params = array(
'number' => $number, 'number' => $this->page_size,
'total' => $total, 'total' => $total,
'where' => $params, 'where' => $this->data_request,
'page' => isset($params['page']) ? intval($params['page']) : 1, 'page' => $this->page,
'url' => MyUrl('admin/order/index'), 'url' => MyUrl('admin/order/index'),
); );
$page = new \base\Page($page_params); $page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表 // 获取列表
$data_params = array( $data_params = array(
'm' => $page->GetPageStarNumber(), 'm' => $page->GetPageStarNumber(),
'n' => $number, 'n' => $this->page_size,
'where' => $where, 'where' => $this->form_where,
'is_public' => 0, 'is_public' => 0,
'user_type' => 'admin', 'user_type' => 'admin',
); );
$data = OrderService::OrderList($data_params); $ret = OrderService::OrderList($data_params);
$this->assign('data_list', $data['data']);
// 状态
$this->assign('common_order_admin_status', lang('common_order_admin_status'));
// 支付状态
$this->assign('common_order_pay_status', lang('common_order_pay_status'));
// 订单模式
$this->assign('common_site_type_list', lang('common_site_type_list'));
// 快递公司
$this->assign('express_list', ExpressService::ExpressList());
// 发起支付 - 支付方式 // 发起支付 - 支付方式
$pay_where = [ $pay_where = [
...@@ -104,17 +80,10 @@ class Order extends Common ...@@ -104,17 +80,10 @@ class Order extends Common
]; ];
$this->assign('buy_payment_list', PaymentService::BuyPaymentList($pay_where)); $this->assign('buy_payment_list', PaymentService::BuyPaymentList($pay_where));
// 支付方式
$this->assign('payment_list', PaymentService::PaymentList());
// 评价状态
$this->assign('common_comments_status_list', lang('common_comments_status_list'));
// 平台
$this->assign('common_platform_type', lang('common_platform_type'));
// 参数 // 参数
$this->assign('params', $params); $this->assign('params', $this->data_request);
$this->assign('page_html', $page->GetPageHtml());
$this->assign('data_list', $ret['data']);
return $this->fetch(); return $this->fetch();
} }
...@@ -127,27 +96,26 @@ class Order extends Common ...@@ -127,27 +96,26 @@ class Order extends Common
*/ */
public function Detail() public function Detail()
{ {
// 参数 if(!empty($this->data_request['id']))
$params = input(); {
$params['user_type'] = 'admin'; // 条件
$where = [
// 条件 ['is_delete_time', '=', 0],
$where = OrderService::OrderListWhere($params); ['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = array( // 获取列表
'm' => 0, $data_params = [
'n' => 1, 'm' => 0,
'where' => $where, 'n' => 1,
'is_public' => 0, 'where' => $where,
'user_type' => 'admin', 'is_public' => 0,
); 'user_type' => 'admin',
$ret = OrderService::OrderList($data_params); ];
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0]; $ret = OrderService::OrderList($data_params);
$this->assign('data', $data); $data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
$this->assign('data', $data);
// 参数 }
$this->assign('params', $params);
return $this->fetch(); return $this->fetch();
} }
......
...@@ -16,7 +16,7 @@ use app\service\RegionService; ...@@ -16,7 +16,7 @@ use app\service\RegionService;
use app\service\BrandService; use app\service\BrandService;
/** /**
* 商品动态表 * 商品动态表
* @author Devil * @author Devil
* @blog http://gong.gg/ * @blog http://gong.gg/
* @version 1.0.0 * @version 1.0.0
...@@ -164,12 +164,12 @@ class Goods ...@@ -164,12 +164,12 @@ class Goods
'view_type' => 'field', 'view_type' => 'field',
'view_key' => 'category_text', 'view_key' => 'category_text',
'search_config' => [ 'search_config' => [
'form_type' => 'module', 'form_type' => 'module',
'template' => 'lib/module/goods_category', 'template' => 'lib/module/goods_category',
'form_name' => 'id', 'form_name' => 'id',
'where_type' => 'in', 'where_type' => 'in',
'where_custom' => 'WhereValueGoodsCategory', 'where_handle_custom' => 'WhereValueGoodsCategory',
'data' => GoodsService::GoodsCategoryAll(), 'data' => GoodsService::GoodsCategoryAll(),
], ],
], ],
[ [
...@@ -206,7 +206,14 @@ class Goods ...@@ -206,7 +206,14 @@ class Goods
'view_key' => 'add_time', 'view_key' => 'add_time',
'search_config' => [ 'search_config' => [
'form_type' => 'datetime', 'form_type' => 'datetime',
'form_name' => 'add_time', ],
],
[
'label' => '更新时间',
'view_type' => 'field',
'view_key' => 'upd_time',
'search_config' => [
'form_type' => 'datetime',
], ],
], ],
[ [
...@@ -227,7 +234,7 @@ class Goods ...@@ -227,7 +234,7 @@ class Goods
* @version 1.0.0 * @version 1.0.0
* @date 2020-06-03 * @date 2020-06-03
* @desc description * @desc description
* @param [string] $name [字段名称] * @param [array] $value [条件值]
* @param [array] $params [输入参数] * @param [array] $params [输入参数]
*/ */
public function WhereValueGoodsCategory($value, $params = []) public function WhereValueGoodsCategory($value, $params = [])
...@@ -241,14 +248,15 @@ class Goods ...@@ -241,14 +248,15 @@ class Goods
} }
// 获取分类下的所有分类 id // 获取分类下的所有分类 id
$category_ids = GoodsService::GoodsCategoryItemsIds($value, 1); $cids = GoodsService::GoodsCategoryItemsIds($value, 1);
// 获取商品 id // 获取商品 id
$goods_ids = Db::name('GoodsCategoryJoin')->where(['category_id'=>$category_ids])->column('goods_id'); $ids = Db::name('GoodsCategoryJoin')->where(['category_id'=>$cids])->column('goods_id');
// 避免空条件造成无效的错觉 // 避免空条件造成无效的错觉
return empty($goods_ids) ? [0] : $goods_ids; return empty($ids) ? [0] : $ids;
} }
return $value; return $value;
} }
} }
\ No newline at end of file ?>
\ No newline at end of file
...@@ -11,17 +11,15 @@ ...@@ -11,17 +11,15 @@
namespace app\admin\form; namespace app\admin\form;
use think\Db; use think\Db;
use app\service\GoodsService;
use app\service\RegionService;
use app\service\BrandService;
use app\service\PaymentService; use app\service\PaymentService;
use app\service\ExpressService;
/** /**
* 订单动态表 * 订单动态表
* @author Devil * @author Devil
* @blog http://gong.gg/ * @blog http://gong.gg/
* @version 1.0.0 * @version 1.0.0
* @date 2020-05-16 * @date 2020-06-08
* @desc description * @desc description
*/ */
class Order class Order
...@@ -36,7 +34,7 @@ class Order ...@@ -36,7 +34,7 @@ class Order
* @author Devil * @author Devil
* @blog http://gong.gg/ * @blog http://gong.gg/
* @version 1.0.0 * @version 1.0.0
* @date 2020-05-16 * @date 2020-06-08
* @desc description * @desc description
* @param [array] $params [输入参数] * @param [array] $params [输入参数]
*/ */
...@@ -78,11 +76,12 @@ class Order ...@@ -78,11 +76,12 @@ class Order
'view_key' => 'order/module/info', 'view_key' => 'order/module/info',
'grid_size' => 'lg', 'grid_size' => 'lg',
'search_config' => [ 'search_config' => [
'form_type' => 'input', 'form_type' => 'input',
'form_name' => 'id', 'form_name' => 'id',
'where_type' => 'in', 'where_type' => 'like',
'placeholder' => '请输入商品名称/型号', 'where_type_custom' => 'in',
'where_custom' => 'WhereValueBaseInfo', 'where_handle_custom' => 'WhereValueBaseInfo',
'placeholder' => '请输入商品名称/型号',
], ],
], ],
[ [
...@@ -91,11 +90,12 @@ class Order ...@@ -91,11 +90,12 @@ class Order
'view_key' => 'order/module/user', 'view_key' => 'order/module/user',
'grid_size' => 'sm', 'grid_size' => 'sm',
'search_config' => [ 'search_config' => [
'form_type' => 'input', 'form_type' => 'input',
'form_name' => 'user_id', 'form_name' => 'user_id',
'where_type' => 'in', 'where_type' => 'like',
'placeholder' => '请输入用户名/昵称/手机/邮箱', 'where_type_custom' => 'in',
'where_custom' => 'WhereValueUserInfo', 'where_handle_custom' => 'WhereValueUserInfo',
'placeholder' => '请输入用户名/昵称/手机/邮箱',
], ],
], ],
[ [
...@@ -104,24 +104,24 @@ class Order ...@@ -104,24 +104,24 @@ class Order
'view_key' => 'order/module/address', 'view_key' => 'order/module/address',
'grid_size' => 'sm', 'grid_size' => 'sm',
'search_config' => [ 'search_config' => [
'form_type' => 'input', 'form_type' => 'input',
'form_name' => 'user_id', 'form_name' => 'id',
'where_type' => 'in', 'where_type' => 'like',
'placeholder' => '请输入收件姓名/电话/地址', 'where_type_custom' => 'in',
'where_custom' => 'WhereValueAddressInfo', 'where_handle_custom' => 'WhereValueAddressInfo',
], ],
], ],
[ [
'label' => '取货信息', 'label' => '取货信息',
'view_type' => 'module', 'view_type' => 'module',
'view_key' => 'order/module/take', 'view_key' => 'order/module/take',
'width' => 120, 'width' => 125,
'search_config' => [ 'search_config' => [
'form_type' => 'input', 'form_type' => 'input',
'form_name' => 'id', 'form_name' => 'id',
'where_type' => '=', 'where_type' => 'like',
'placeholder' => '请输入取货码', 'where_type_custom' => 'in',
'where_custom' => 'WhereValueAddressInfo', 'where_handle_custom' => 'WhereValueTakeInfo',
], ],
], ],
[ [
...@@ -164,7 +164,7 @@ class Order ...@@ -164,7 +164,7 @@ class Order
'form_name' => 'order_model', 'form_name' => 'order_model',
'where_type' => 'in', 'where_type' => 'in',
'data' => lang('common_site_type_list'), 'data' => lang('common_site_type_list'),
'data_key' => 'id', 'data_key' => 'value',
'data_name' => 'name', 'data_name' => 'name',
'is_multiple' => 1, 'is_multiple' => 1,
], ],
...@@ -179,7 +179,7 @@ class Order ...@@ -179,7 +179,7 @@ class Order
'form_name' => 'client_type', 'form_name' => 'client_type',
'where_type' => 'in', 'where_type' => 'in',
'data' => lang('common_platform_type'), 'data' => lang('common_platform_type'),
'data_key' => 'id', 'data_key' => 'value',
'data_name' => 'name', 'data_name' => 'name',
'is_multiple' => 1, 'is_multiple' => 1,
], ],
...@@ -272,15 +272,26 @@ class Order ...@@ -272,15 +272,26 @@ class Order
], ],
], ],
[ [
'label' => '快递信息', 'label' => '快递公司',
'view_type' => 'module', 'view_type' => 'field',
'view_key' => 'order/module/express', 'view_key' => 'express_name',
'grid_size' => 'sm', 'search_config' => [
'form_type' => 'select',
'form_name' => 'express_id',
'data' => ExpressService::ExpressList(),
'where_type' => 'in',
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '快递单号',
'view_type' => 'field',
'view_key' => 'express_number',
'search_config' => [ 'search_config' => [
'form_type' => 'input', 'form_type' => 'input',
'form_name' => 'express_number',
'where_type' => 'like', 'where_type' => 'like',
'placeholder' => '请输入快递单号',
], ],
], ],
[ [
...@@ -289,6 +300,22 @@ class Order ...@@ -289,6 +300,22 @@ class Order
'view_key' => 'order/module/aftersale', 'view_key' => 'order/module/aftersale',
'grid_size' => 'sm', 'grid_size' => 'sm',
], ],
[
'label' => '创建时间',
'view_type' => 'field',
'view_key' => 'add_time',
'search_config' => [
'form_type' => 'datetime',
],
],
[
'label' => '更新时间',
'view_type' => 'field',
'view_key' => 'upd_time',
'search_config' => [
'form_type' => 'datetime',
],
],
[ [
'label' => '操作', 'label' => '操作',
'view_type' => 'operate', 'view_type' => 'operate',
...@@ -301,34 +328,95 @@ class Order ...@@ -301,34 +328,95 @@ class Order
} }
/** /**
* 商品分类条件处理 * 取货码条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-08
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
public function WhereValueTakeInfo($value, $params = [])
{
if(!empty($value))
{
// 获取订单 id
$ids = Db::name('OrderExtractionCode')->where('code', '=', $value)->column('order_id');
// 避免空条件造成无效的错觉
return empty($ids) ? [0] : $ids;
}
return $value;
}
/**
* 收件地址条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-08
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
public function WhereValueAddressInfo($value, $params = [])
{
if(!empty($value))
{
// 获取订单 id
$ids = Db::name('OrderAddress')->where('name|tel|address', 'like', '%'.$value.'%')->column('order_id');
// 避免空条件造成无效的错觉
return empty($ids) ? [0] : $ids;
}
return $value;
}
/**
* 用户信息条件处理
* @author Devil * @author Devil
* @blog http://gong.gg/ * @blog http://gong.gg/
* @version 1.0.0 * @version 1.0.0
* @date 2020-06-03 * @date 2020-06-08
* @desc description * @desc description
* @param [string] $name [字段名称] * @param [string] $value [条件值]
* @param [array] $params [输入参数] * @param [array] $params [输入参数]
*/ */
public function WhereValueGoodsCategory($value, $params = []) public function WhereValueUserInfo($value, $params = [])
{ {
if(!empty($value)) if(!empty($value))
{ {
// 是否为数组 // 获取用户 id
if(!is_array($value)) $ids = Db::name('User')->where('username|nickname|mobile|email', 'like', '%'.$value.'%')->column('id');
{
$value = [$value];
}
// 获取分类下的所有分类 id // 避免空条件造成无效的错觉
$category_ids = GoodsService::GoodsCategoryItemsIds($value, 1); return empty($ids) ? [0] : $ids;
}
return $value;
}
// 获取商品 id /**
$goods_ids = Db::name('GoodsCategoryJoin')->where(['category_id'=>$category_ids])->column('goods_id'); * 基础信息条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-08
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
public function WhereValueBaseInfo($value, $params = [])
{
if(!empty($value))
{
// 获取订单详情搜索的订单 id
$ids = Db::name('OrderDetail')->where('title|model', 'like', '%'.$value.'%')->column('order_id');
// 避免空条件造成无效的错觉 // 避免空条件造成无效的错觉
return empty($goods_ids) ? [0] : $goods_ids; return empty($ids) ? [0] : $ids;
} }
return $value; return $value;
} }
} }
\ No newline at end of file ?>
\ No newline at end of file
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
<dt>基础信息</dt> <dt>基础信息</dt>
<dd> <dd>
{{foreach $data.items as $vs}} {{foreach $data.items as $vs}}
<div class="goods-item"> <div class="am-nbfc am-padding-vertical-xs">
<div class="base"> <div class="base am-nbfc">
<a href="{{:MyUrl('index/goods/index', ['id'=>$vs['goods_id']])}}" target="_blank" title="{{$vs.title}}"> <a href="{{:MyUrl('index/goods/index', ['id'=>$vs['goods_id']])}}" target="_blank" title="{{$vs.title}}">
<img src="{{$vs['images']}}" class="am-img-thumbnail am-radius goods-images" /> <img src="{{$vs['images']}}" class="am-img-thumbnail am-radius am-margin-right-xs am-fl" width="60" height="60" />
</a> </a>
<a href="{{:MyUrl('index/goods/index', ['id'=>$vs['goods_id']])}}" target="_blank" title="{{$vs.title}}" {{if !empty($vs['title_color'])}} style="color:{{$vs.title_color}};" {{/if}} class="am-nowrap-initial">{{$vs.title}}</a> <a href="{{:MyUrl('index/goods/index', ['id'=>$vs['goods_id']])}}" target="_blank" title="{{$vs.title}}" {{if !empty($vs['title_color'])}} style="color:{{$vs.title_color}};" {{/if}} class="am-nowrap-initial">{{$vs.title}}</a>
</div> </div>
...@@ -59,10 +59,10 @@ ...@@ -59,10 +59,10 @@
编码:{{$vs.spec_coding}} 编码:{{$vs.spec_coding}}
</span> </span>
{{/if}} {{/if}}
<span class="am-fr">{{$vs.price}}x{{$vs.buy_number}}</span>
{{if $vs['returned_quantity'] gt 0 or $vs['refund_price'] gt 0}} {{if $vs['returned_quantity'] gt 0 or $vs['refund_price'] gt 0}}
<span class="am-text-danger am-fr am-margin-left-sm">已退 {{$vs.returned_quantity}} / {{$vs.refund_price}}</span> <span class="am-text-danger am-fr am-margin-right-lg">已退 {{$vs.returned_quantity}} / {{$vs.refund_price}}</span>
{{/if}} {{/if}}
<span class="am-fr">{{$vs.price}}x{{$vs.buy_number}}</span>
</div> </div>
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-vertical-0" /> <hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-vertical-0" />
</div> </div>
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
</p> </p>
{{if !empty($data['extraction_data']['images'])}} {{if !empty($data['extraction_data']['images'])}}
<p class="am-margin-top-xs"> <p class="am-margin-top-xs">
<img class="am-img-thumbnail" src="{{$data.extraction_data.images}}" alt="取货码" /> <img class="am-img-thumbnail" src="{{$data.extraction_data.images}}" alt="取货码" width="150" height="150" />
</p> </p>
{{/if}} {{/if}}
{{else /}} {{else /}}
......
<!-- 快递信息 -->
{{if !empty($module_data) and !empty($module_data['express_name'])}}
<p>快递:{{$module_data.express_name}}</p>
<p>单号:{{$module_data.express_number}}</p>
{{/if}}
\ No newline at end of file
<!-- 订单基础信息 --> <!-- 订单基础信息 -->
{{if !empty($module_data) and !empty($module_data['items'])}} {{if !empty($module_data) and !empty($module_data['items'])}}
{{foreach $module_data.items as $item}} {{foreach $module_data.items as $key=>$item}}
<div class="am-nbfc am-padding-vertical-xs"> {{if $key eq 0}}
<div class="base am-nbfc"> <div class="am-nbfc am-padding-vertical-xs">
<a href="{{:MyUrl('index/goods/index', ['id'=>$item['goods_id']])}}" target="_blank" title="{{$item.title}}"> <div class="base am-nbfc">
<img src="{{$item['images']}}" class="am-img-thumbnail am-radius am-margin-right-xs am-fl" width="60" height="60" /> <a href="{{:MyUrl('index/goods/index', ['id'=>$item['goods_id']])}}" target="_blank" title="{{$item.title}}">
</a> <img src="{{$item['images']}}" class="am-img-thumbnail am-radius am-margin-right-xs am-fl" width="60" height="60" />
<a href="{{:MyUrl('index/goods/index', ['id'=>$item['goods_id']])}}" target="_blank" title="{{$item.title}}" {{if !empty($item['title_color'])}} style="color:{{$item.title_color}};" {{/if}} class="am-nowrap-initial">{{$item.title}}</a> </a>
</div> <a href="{{:MyUrl('index/goods/index', ['id'=>$item['goods_id']])}}" target="_blank" title="{{$item.title}}" {{if !empty($item['title_color'])}} style="color:{{$item.title_color}};" {{/if}} class="am-nowrap-initial">{{$item.title}}</a>
<div class="other am-nbfc"> </div>
<span class="am-fl am-text-xs am-nowrap-initial"> <div class="other am-nbfc">
{{if !empty($item.spec_text)}} <span class="am-fl am-text-xs am-nowrap-initial">
{{$item.spec_text}} {{if !empty($item.spec_text)}}
{{$item.spec_text}}
{{/if}}
</span>
<span class="am-fr">{{$item.price}}x{{$item.buy_number}}</span>
{{if $item['returned_quantity'] gt 0 or $item['refund_price'] gt 0}}
<span class="am-text-danger am-fr am-margin-right-lg">已退 {{$item.returned_quantity}} / {{$item.refund_price}}</span>
{{/if}} {{/if}}
</span> </div>
<span class="am-fr">{{$item.price}}x{{$item.buy_number}}</span>
{{if $item['returned_quantity'] gt 0 or $item['refund_price'] gt 0}}
<span class="am-text-danger am-fr am-margin-right-lg">已退 {{$item.returned_quantity}} / {{$item.refund_price}}</span>
{{/if}}
</div> </div>
</div> <hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-vertical-0" />
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-vertical-0" /> {{/if}}
{{php}}break;{{/php}}
{{/foreach}} {{/foreach}}
<div class="am-margin-top-sm">{{$module_data.describe}}</div> <div class="am-margin-top-sm">{{$module_data.describe}}</div>
{{if count($module_data.items) gt 1}}
<div class="am-text-center">
<button type="button" class="am-btn am-btn-link am-btn-xs am-radius submit-popup" data-url="{{:MyUrl('admin/order/detail', ['id'=>$module_data['id']])}}">
<i class="am-icon-caret-down"></i>
<span>查看更多</span>
</button>
</div>
{{/if}}
{{/if}} {{/if}}
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<p> <p>
<span>取货码:</span> <span>取货码:</span>
{{if empty($module_data['extraction_data']['code'])}} {{if empty($module_data['extraction_data']['code'])}}
<span class="am-text-danger">取货码不存在、请联系管理员</span> <span class="am-text-danger"></span>
{{else /}} {{else /}}
<span class="am-badge am-badge-success am-radius">{{$module_data.extraction_data.code}}</span> <span class="am-badge am-badge-success am-radius">{{$module_data.extraction_data.code}}</span>
{{/if}} {{/if}}
......
...@@ -102,7 +102,7 @@ return array( ...@@ -102,7 +102,7 @@ return array(
'common_order_admin_status' => array( 'common_order_admin_status' => array(
0 => array('id' => 0, 'name' => '待确认', 'checked' => true), 0 => array('id' => 0, 'name' => '待确认', 'checked' => true),
1 => array('id' => 1, 'name' => '已确认/待支付'), 1 => array('id' => 1, 'name' => '已确认/待支付'),
2 => array('id' => 2, 'name' => '已支付/待发货/待取货'), 2 => array('id' => 2, 'name' => '待发货/待取货'),
3 => array('id' => 3, 'name' => '已发货/待收货'), 3 => array('id' => 3, 'name' => '已发货/待收货'),
4 => array('id' => 4, 'name' => '已完成'), 4 => array('id' => 4, 'name' => '已完成'),
5 => array('id' => 5, 'name' => '已取消'), 5 => array('id' => 5, 'name' => '已取消'),
......
...@@ -248,8 +248,11 @@ class FormHandleModule ...@@ -248,8 +248,11 @@ class FormHandleModule
$name = $v['search_config']['form_name']; $name = $v['search_config']['form_name'];
// 条件类型 // 条件类型
$type = isset($v['search_config']['where_type']) ? $v['search_config']['where_type'] : $v['search_config']['form_type']; $type = isset($v['search_config']['where_type']) ? $v['search_config']['where_type'] : $v['search_config']['form_type'];
// 是否自定义条件类型
$type_custom = isset($v['search_config']['where_type_custom']) ? $v['search_config']['where_type_custom'] : $type;
// 是否自定义条件处理方法 // 是否自定义条件处理方法
$custom = isset($v['search_config']['where_custom']) ? $v['search_config']['where_custom'] : ''; $handle_custom = isset($v['search_config']['where_handle_custom']) ? $v['search_config']['where_handle_custom'] : '';
// 根据条件类型处理 // 根据条件类型处理
switch($type) switch($type)
{ {
...@@ -267,16 +270,16 @@ class FormHandleModule ...@@ -267,16 +270,16 @@ class FormHandleModule
$this->where_params[$form_key] = $value; $this->where_params[$form_key] = $value;
// 条件值处理 // 条件值处理
$value = $this->WhereValueHandle($value, $custom); $value = $this->WhereValueHandle($value, $handle_custom);
// 是否 like 条件 // 是否 like 条件
if($type == 'like') if($type == 'like' && is_string($value))
{ {
$value = '%'.$value.'%'; $value = '%'.$value.'%';
} }
// 条件 // 条件
$this->where[] = [$name, $type, $value]; $this->where[] = [$name, $type_custom, $value];
} }
break; break;
...@@ -293,7 +296,7 @@ class FormHandleModule ...@@ -293,7 +296,7 @@ class FormHandleModule
$this->where_params[$form_key] = $value; $this->where_params[$form_key] = $value;
// 条件 // 条件
$this->where[] = [$name, $type, $this->WhereValueHandle($value, $custom)]; $this->where[] = [$name, $type_custom, $this->WhereValueHandle($value, $handle_custom)];
} }
break; break;
...@@ -308,7 +311,7 @@ class FormHandleModule ...@@ -308,7 +311,7 @@ class FormHandleModule
$this->where_params[$key_min] = $value; $this->where_params[$key_min] = $value;
// 条件 // 条件
$this->where[] = [$name, '>=', $this->WhereValueHandle($value, $custom, ['is_min'=>1])]; $this->where[] = [$name, '>=', $this->WhereValueHandle($value, $handle_custom, ['is_min'=>1])];
} }
if(array_key_exists($key_max, $this->out_params) && $this->out_params[$key_max] !== null && $this->out_params[$key_max] !== '') if(array_key_exists($key_max, $this->out_params) && $this->out_params[$key_max] !== null && $this->out_params[$key_max] !== '')
{ {
...@@ -317,7 +320,7 @@ class FormHandleModule ...@@ -317,7 +320,7 @@ class FormHandleModule
$this->where_params[$key_max] = $value; $this->where_params[$key_max] = $value;
// 条件 // 条件
$this->where[] = [$name, '<=', $this->WhereValueHandle($value, $custom, ['is_end'=>1])]; $this->where[] = [$name, '<=', $this->WhereValueHandle($value, $handle_custom, ['is_end'=>1])];
} }
break; break;
...@@ -333,7 +336,7 @@ class FormHandleModule ...@@ -333,7 +336,7 @@ class FormHandleModule
$this->where_params[$key_start] = $value; $this->where_params[$key_start] = $value;
// 条件 // 条件
$this->where[] = [$name, '>=', $this->WhereValueHandle(strtotime($value), $custom, ['is_start'=>1])]; $this->where[] = [$name, '>=', $this->WhereValueHandle(strtotime($value), $handle_custom, ['is_start'=>1])];
} }
if(array_key_exists($key_end, $this->out_params) && $this->out_params[$key_end] !== null && $this->out_params[$key_end] !== '') if(array_key_exists($key_end, $this->out_params) && $this->out_params[$key_end] !== null && $this->out_params[$key_end] !== '')
{ {
...@@ -342,7 +345,7 @@ class FormHandleModule ...@@ -342,7 +345,7 @@ class FormHandleModule
$this->where_params[$key_end] = $value; $this->where_params[$key_end] = $value;
// 条件 // 条件
$this->where[] = [$name, '<=', $this->WhereValueHandle(strtotime($value), $custom, ['is_end'=>1])]; $this->where[] = [$name, '<=', $this->WhereValueHandle(strtotime($value), $handle_custom, ['is_end'=>1])];
} }
break; break;
...@@ -434,15 +437,15 @@ class FormHandleModule ...@@ -434,15 +437,15 @@ class FormHandleModule
* @date 2020-06-04 * @date 2020-06-04
* @desc description * @desc description
* @param [mixed] $value [条件值] * @param [mixed] $value [条件值]
* @param [mixed] $custom [自定义处理方法名称] * @param [string] $action [自定义处理方法名称]
* @param [array] $params [输入参数] * @param [array] $params [输入参数]
*/ */
function WhereValueHandle($value, $custom = '', $params = []) function WhereValueHandle($value, $action = '', $params = [])
{ {
// 模块是否自定义方法处理条件 // 模块是否自定义方法处理条件
if(!empty($custom) && method_exists($this->module_obj, $custom)) if(!empty($action) && method_exists($this->module_obj, $action))
{ {
return $this->module_obj->$custom($value, $params); return $this->module_obj->$action($value, $params);
} }
// 默认直接返回值 // 默认直接返回值
......
...@@ -853,7 +853,7 @@ class OrderService ...@@ -853,7 +853,7 @@ class OrderService
$v['add_time'] = date('Y-m-d H:i:s', $v['add_time']); $v['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
// 更新时间 // 更新时间
$v['upd_time'] = date('Y-m-d H:i:s', $v['upd_time']); $v['upd_time'] = empty($v['upd_time']) ? null : date('Y-m-d H:i:s', $v['upd_time']);
// 确认时间 // 确认时间
$v['confirm_time'] = empty($v['confirm_time']) ? null : date('Y-m-d H:i:s', $v['confirm_time']); $v['confirm_time'] = empty($v['confirm_time']) ? null : date('Y-m-d H:i:s', $v['confirm_time']);
......
/**
* 商品列表
*/
.goods-images { width: 60px; height: 60px; float: left; margin-right: 5px; }
.goods-item,
.goods-item .base,
.goods-item .other { overflow: hidden; }
/** /**
* 业务弹窗 * 业务弹窗
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册