diff --git a/application/admin/form/Answer.php b/application/admin/form/Answer.php index 946ccf547..bfe1aa846 100644 --- a/application/admin/form/Answer.php +++ b/application/admin/form/Answer.php @@ -67,7 +67,7 @@ class Answer 'form_name' => 'user_id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueUserInfo', + 'where_value_custom' => 'WhereValueUserInfo', 'placeholder' => '请输入用户名/昵称/手机/邮箱', ], ], diff --git a/application/admin/form/Brand.php b/application/admin/form/Brand.php index 0433e53f8..739989713 100644 --- a/application/admin/form/Brand.php +++ b/application/admin/form/Brand.php @@ -97,7 +97,7 @@ class Brand 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, - 'where_handle_custom' => 'WhereValueBrandCategory', + 'where_value_custom' => 'WhereValueBrandCategory', ], ], [ diff --git a/application/admin/form/Goods.php b/application/admin/form/Goods.php index b931694fd..552010c71 100644 --- a/application/admin/form/Goods.php +++ b/application/admin/form/Goods.php @@ -94,7 +94,7 @@ class Goods 'template' => 'lib/module/goods_category', 'form_name' => 'id', 'where_type' => 'in', - 'where_handle_custom' => 'WhereValueGoodsCategory', + 'where_value_custom' => 'WhereValueGoodsCategory', 'data' => GoodsService::GoodsCategoryAll(), ], ], diff --git a/application/admin/form/Goodsbrowse.php b/application/admin/form/Goodsbrowse.php index 887f22e14..39001b005 100644 --- a/application/admin/form/Goodsbrowse.php +++ b/application/admin/form/Goodsbrowse.php @@ -66,7 +66,7 @@ class Goodsbrowse 'form_name' => 'b.user_id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueUserInfo', + 'where_value_custom' => 'WhereValueUserInfo', 'placeholder' => '请输入用户名/昵称/手机/邮箱', ], ], diff --git a/application/admin/form/Goodscomments.php b/application/admin/form/Goodscomments.php index 00819a832..06f9948a8 100644 --- a/application/admin/form/Goodscomments.php +++ b/application/admin/form/Goodscomments.php @@ -67,7 +67,7 @@ class Goodscomments 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereGoodsInfo', + 'where_value_custom' => 'WhereGoodsInfo', 'placeholder' => '请输入商品名称/型号', ], ], @@ -81,7 +81,7 @@ class Goodscomments 'form_name' => 'user_id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueUserInfo', + 'where_value_custom' => 'WhereValueUserInfo', 'placeholder' => '请输入用户名/昵称/手机/邮箱', ], ], diff --git a/application/admin/form/Goodsfavor.php b/application/admin/form/Goodsfavor.php index 68d0623e6..4bbf37f30 100644 --- a/application/admin/form/Goodsfavor.php +++ b/application/admin/form/Goodsfavor.php @@ -66,7 +66,7 @@ class Goodsfavor 'form_name' => 'f.user_id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueUserInfo', + 'where_value_custom' => 'WhereValueUserInfo', 'placeholder' => '请输入用户名/昵称/手机/邮箱', ], ], diff --git a/application/admin/form/Integrallog.php b/application/admin/form/Integrallog.php index ea4ddd11b..610c47d61 100644 --- a/application/admin/form/Integrallog.php +++ b/application/admin/form/Integrallog.php @@ -55,7 +55,7 @@ class Integrallog 'form_name' => 'user_id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueUserInfo', + 'where_value_custom' => 'WhereValueUserInfo', 'placeholder' => '请输入用户名/昵称/手机/邮箱', ], ], diff --git a/application/admin/form/Message.php b/application/admin/form/Message.php index c085a83b2..fc4e9e871 100644 --- a/application/admin/form/Message.php +++ b/application/admin/form/Message.php @@ -68,7 +68,7 @@ class Message 'form_name' => 'user_id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueUserInfo', + 'where_value_custom' => 'WhereValueUserInfo', 'placeholder' => '请输入用户名/昵称/手机/邮箱', ], ], diff --git a/application/admin/form/Order.php b/application/admin/form/Order.php index 5c39ec0f6..67e1803ee 100644 --- a/application/admin/form/Order.php +++ b/application/admin/form/Order.php @@ -62,7 +62,7 @@ class Order 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereBaseGoodsInfo', + 'where_value_custom' => 'WhereBaseGoodsInfo', 'placeholder' => '请输入订单ID/订单号/商品名称/型号', ], ], @@ -76,7 +76,7 @@ class Order 'form_name' => 'user_id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueUserInfo', + 'where_value_custom' => 'WhereValueUserInfo', 'placeholder' => '请输入用户名/昵称/手机/邮箱', ], ], @@ -190,7 +190,7 @@ class Order 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueAddressInfo', + 'where_value_custom' => 'WhereValueAddressInfo', ], ], [ @@ -204,7 +204,7 @@ class Order 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueTakeInfo', + 'where_value_custom' => 'WhereValueTakeInfo', ], ], [ diff --git a/application/admin/form/Orderaftersale.php b/application/admin/form/Orderaftersale.php index 027177c1a..a6de96c1d 100644 --- a/application/admin/form/Orderaftersale.php +++ b/application/admin/form/Orderaftersale.php @@ -56,7 +56,7 @@ class Orderaftersale 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereBaseGoodsInfo', + 'where_value_custom' => 'WhereBaseGoodsInfo', 'placeholder' => '请输入订单号/商品名称/型号', ], ], @@ -70,7 +70,7 @@ class Orderaftersale 'form_name' => 'user_id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueUserInfo', + 'where_value_custom' => 'WhereValueUserInfo', 'placeholder' => '请输入用户名/昵称/手机/邮箱', ], ], diff --git a/application/admin/form/Paylog.php b/application/admin/form/Paylog.php index 8508e0b79..3502f1b3d 100644 --- a/application/admin/form/Paylog.php +++ b/application/admin/form/Paylog.php @@ -57,7 +57,7 @@ class Paylog 'form_name' => 'user_id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueUserInfo', + 'where_value_custom' => 'WhereValueUserInfo', 'placeholder' => '请输入用户名/昵称/手机/邮箱', ], ], @@ -142,7 +142,7 @@ class Paylog 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueBusinessInfo', + 'where_value_custom' => 'WhereValueBusinessInfo', ], ], [ diff --git a/application/admin/form/Refundlog.php b/application/admin/form/Refundlog.php index 2d4faca70..a82315aa4 100644 --- a/application/admin/form/Refundlog.php +++ b/application/admin/form/Refundlog.php @@ -56,7 +56,7 @@ class Refundlog 'form_name' => 'user_id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueUserInfo', + 'where_value_custom' => 'WhereValueUserInfo', 'placeholder' => '请输入用户名/昵称/手机/邮箱', ], ], diff --git a/application/admin/form/Warehousegoods.php b/application/admin/form/Warehousegoods.php index 086ca3956..0903d9069 100644 --- a/application/admin/form/Warehousegoods.php +++ b/application/admin/form/Warehousegoods.php @@ -70,7 +70,7 @@ class Warehousegoods 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereGoodsInfo', + 'where_value_custom' => 'WhereGoodsInfo', 'placeholder' => '请输入商品名称/型号', ], ], diff --git a/application/index/controller/Orderaftersale.php b/application/index/controller/Orderaftersale.php index 0d276d1d9..5f3e6a0ed 100644 --- a/application/index/controller/Orderaftersale.php +++ b/application/index/controller/Orderaftersale.php @@ -139,7 +139,8 @@ class Orderaftersale extends Common // 编辑器文件存放地址 $this->assign('editor_path_type', 'order_aftersale-'.$this->user['id'].'-'.$order_id.'-'.$order_detail_id); - $this->assign('form_search_keywords_name', 'fp0'); + // 订单售后搜索form key + $this->assign('form_search_keywords_form_key', 'f0p'); $this->assign('params', $this->data_request); return $this->fetch(); } else { diff --git a/application/index/controller/User.php b/application/index/controller/User.php index 076466aa4..fd3836f84 100755 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -138,6 +138,10 @@ class User extends Common $data = GoodsBrowseService::GoodsBrowseList($browse_params); $this->assign('goods_browse_list', $data['data']); + // 订单页面订单状态form key + $this->assign('form_search_order_status_form_key', 'f2p'); + $this->assign('form_search_order_user_is_comments_form_key', 'f21p'); + // 钩子 $this->PluginsHook(); diff --git a/application/index/form/Order.php b/application/index/form/Order.php index 889ba94cc..32554f0a8 100644 --- a/application/index/form/Order.php +++ b/application/index/form/Order.php @@ -90,7 +90,7 @@ class Order 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereBaseGoodsInfo', + 'where_value_custom' => 'WhereBaseGoodsInfo', 'placeholder' => '请输入订单号/商品名称/型号', ], ], @@ -190,7 +190,7 @@ class Order 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueAddressInfo', + 'where_value_custom' => 'WhereValueAddressInfo', ], ], [ @@ -203,7 +203,7 @@ class Order 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueTakeInfo', + 'where_value_custom' => 'WhereValueTakeInfo', ], ], [ @@ -306,6 +306,22 @@ class Order 'where_type' => 'like', ], ], + [ + 'label' => '是否评价', + 'view_type' => 'module', + 'view_key' => 'order/module/is_comments', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'form_name' => 'user_is_comments', + 'data' => lang('common_is_text_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'where_type_custom' => 'WhereTypyUserIsComments', + 'where_value_custom' => 'WhereValueUserIsComments', + 'is_multiple' => 1, + ], + ], [ 'label' => '确认时间', 'view_type' => 'field', @@ -381,6 +397,40 @@ class Order ]; } + /** + * 取货码条件处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-08 + * @desc description + * @param [string] $form_key [表单数据key] + * @param [array] $params [输入参数] + */ + public function WhereTypyUserIsComments($form_key, $params) + { + if(isset($params[$form_key])) + { + return ($params[$form_key] == 0) ? '=' : '>'; + } + return null; + } + + /** + * 取货码条件处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-08 + * @desc description + * @param [string] $form_key [表单数据key] + * @param [array] $params [输入参数] + */ + public function WhereValueUserIsComments($value, $params = []) + { + return (count($value) == 2) ? null : 0; + } + /** * 取货码条件处理 * @author Devil diff --git a/application/index/form/Orderaftersale.php b/application/index/form/Orderaftersale.php index 2eec760d3..00bbf5118 100644 --- a/application/index/form/Orderaftersale.php +++ b/application/index/form/Orderaftersale.php @@ -73,7 +73,7 @@ class Orderaftersale 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereBaseGoodsInfo', + 'where_value_custom' => 'WhereBaseGoodsInfo', 'placeholder' => '请输入订单号/商品名称/型号', ], ], diff --git a/application/index/view/default/order/module/is_comments.html b/application/index/view/default/order/module/is_comments.html new file mode 100644 index 000000000..53a87908c --- /dev/null +++ b/application/index/view/default/order/module/is_comments.html @@ -0,0 +1,2 @@ + +{{if !empty($module_data) and isset($module_data['user_is_comments']) and $module_data['user_is_comments'] gt 1}}已{{else /}}未{{/if}}评价 \ No newline at end of file diff --git a/application/index/view/default/orderaftersale/detail.html b/application/index/view/default/orderaftersale/detail.html index cae9984c9..6decb473b 100644 --- a/application/index/view/default/orderaftersale/detail.html +++ b/application/index/view/default/orderaftersale/detail.html @@ -112,7 +112,7 @@ {{if isset($new_aftersale_data['status']) and $new_aftersale_data['status'] eq 5}}
- {{$new_aftersale_data.tips_msg}}查看售后订单 + {{$new_aftersale_data.tips_msg}}查看售后订单
{{/if}} @@ -149,7 +149,7 @@ {{case 0|1|2}} {{if $new_aftersale_data['status'] eq 1 and $new_aftersale_data['type'] eq 1}}
- {{$new_aftersale_data.tips_msg}}查看售后订单 + {{$new_aftersale_data.tips_msg}}查看售后订单
@@ -159,14 +159,14 @@ {{include file="orderaftersale/delivery" /}} {{else /}}
- {{$new_aftersale_data.tips_msg}}查看售后订单 + {{$new_aftersale_data.tips_msg}}查看售后订单
{{/if}} {{/case}} {{case 3|4}}
- {{$new_aftersale_data.tips_msg}}查看售后订单 + {{$new_aftersale_data.tips_msg}}查看售后订单
{{/case}} {{/switch}} diff --git a/application/index/view/default/user/index.html b/application/index/view/default/user/index.html index 968bfbca2..05c49e273 100755 --- a/application/index/view/default/user/index.html +++ b/application/index/view/default/user/index.html @@ -107,7 +107,7 @@ {{foreach $user_order_status as $v}} {{if in_array($v['status'], [1,2,3])}}
  • - +

    {{$v.name}}

    {{if !empty($v.count)}} @@ -117,7 +117,7 @@
  • {{elseif in_array($v['status'], [100]) /}}
  • - +

    {{$v.name}}

    {{if !empty($v.count)}} diff --git a/application/module/FormHandleModule.php b/application/module/FormHandleModule.php index 9fdefe90c..7bc2e1eab 100644 --- a/application/module/FormHandleModule.php +++ b/application/module/FormHandleModule.php @@ -230,7 +230,7 @@ class FormHandleModule $label = empty($v['label']) ? '' : $v['label']; // 唯一 formkey - $form_key = 'fp'.$k; + $form_key = 'f'.$k.'p'; $v['form_key'] = $form_key; // 根据组件类型处理 @@ -296,14 +296,16 @@ class FormHandleModule // 表单字段名称 $name = $v['search_config']['form_name']; // 条件类型 - $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; + $where_type = isset($v['search_config']['where_type']) ? $v['search_config']['where_type'] : $v['search_config']['form_type']; + // 是否自定义条件处理 + $where_custom = isset($v['search_config']['where_type_custom']) ? $v['search_config']['where_type_custom'] : ''; + // 条件类型 + $where_symbol = $this->WhereSymbolHandle($form_key, $where_custom, $where_type); // 是否自定义条件处理方法 - $handle_custom = isset($v['search_config']['where_handle_custom']) ? $v['search_config']['where_handle_custom'] : ''; + $value_custom = isset($v['search_config']['where_value_custom']) ? $v['search_config']['where_value_custom'] : ''; // 根据条件类型处理 - switch($type) + switch($where_type) { // 单个值 case '=' : @@ -319,16 +321,18 @@ class FormHandleModule $this->where_params[$form_key] = $value; // 条件值处理 - $value = $this->WhereValueHandle($value, $handle_custom); - - // 是否 like 条件 - if($type == 'like' && is_string($value)) + $value = $this->WhereValueHandle($value, $value_custom); + if($value !== null && $value !== '') { - $value = '%'.$value.'%'; - } + // 是否 like 条件 + if($where_type == 'like' && is_string($value)) + { + $value = '%'.$value.'%'; + } - // 条件 - $this->where[] = [$name, $type_custom, $value]; + // 条件 + $this->where[] = [$name, $where_symbol, $value]; + } } break; @@ -345,7 +349,20 @@ class FormHandleModule $this->where_params[$form_key] = $value; // 条件 - $this->where[] = [$name, $type_custom, $this->WhereValueHandle($value, $handle_custom)]; + $value = $this->WhereValueHandle($value, $value_custom); + // in条件必须存在值也必须是数组 + if($where_symbol == 'in') + { + if(!empty($value) && is_array($value)) + { + $this->where[] = [$name, $where_symbol, $value]; + } + } else { + if($value !== null && $value !== '') + { + $this->where[] = [$name, $where_symbol, $value]; + } + } } break; @@ -360,7 +377,11 @@ class FormHandleModule $this->where_params[$key_min] = $value; // 条件 - $this->where[] = [$name, '>=', $this->WhereValueHandle($value, $handle_custom, ['is_min'=>1])]; + $value = $this->WhereValueHandle($value, $value_custom, ['is_min'=>1]); + if($value !== null && $value !== '') + { + $this->where[] = [$name, '>=', $value]; + } } if(array_key_exists($key_max, $this->out_params) && $this->out_params[$key_max] !== null && $this->out_params[$key_max] !== '') { @@ -369,7 +390,11 @@ class FormHandleModule $this->where_params[$key_max] = $value; // 条件 - $this->where[] = [$name, '<=', $this->WhereValueHandle($value, $handle_custom, ['is_end'=>1])]; + $value = $this->WhereValueHandle($value, $value_custom, ['is_end'=>1]); + if($value !== null && $value !== '') + { + $this->where[] = [$name, '<=', $value]; + } } break; @@ -385,7 +410,11 @@ class FormHandleModule $this->where_params[$key_start] = $value; // 条件 - $this->where[] = [$name, '>=', $this->WhereValueHandle(strtotime($value), $handle_custom, ['is_start'=>1])]; + $value = $this->WhereValueHandle(strtotime($value), $value_custom, ['is_start'=>1]); + if($value !== null && $value !== '') + { + $this->where[] = [$name, '>=', $value]; + } } if(array_key_exists($key_end, $this->out_params) && $this->out_params[$key_end] !== null && $this->out_params[$key_end] !== '') { @@ -394,8 +423,11 @@ class FormHandleModule $this->where_params[$key_end] = $value; // 条件 - $this->where[] = [$name, '<=', $this->WhereValueHandle(strtotime($value), $handle_custom, ['is_end'=>1])]; - + $value = $this->WhereValueHandle(strtotime($value), $value_custom, ['is_end'=>1]); + if($value !== null && $value !== '') + { + $this->where[] = [$name, '<=', $value]; + } } break; } @@ -478,6 +510,39 @@ class FormHandleModule } } + /** + * 条件符号处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-08-20 + * @desc description + * @param [string] $form_key [表单key] + * @param [stribg] $where_custom [自定义条件值] + * @param [stribg] $where_type [条件类型] + */ + public function WhereSymbolHandle($form_key, $where_custom, $where_type) + { + // 是否已定义自定义条件符号 + if(!empty($where_custom)) + { + // 模块是否自定义条件方法处理条件 + if(method_exists($this->module_obj, $where_custom)) + { + $value = $this->module_obj->$where_custom($form_key, $this->out_params); + if(!empty($value)) + { + return $value; + } + } else { + return $where_custom; + } + } + + // 默认条件类型 + return $where_type; + } + /** * 条件值处理 * @author Devil @@ -489,9 +554,9 @@ class FormHandleModule * @param [string] $action [自定义处理方法名称] * @param [array] $params [输入参数] */ - function WhereValueHandle($value, $action = '', $params = []) + public function WhereValueHandle($value, $action = '', $params = []) { - // 模块是否自定义方法处理条件 + // 模块是否自定义条件值方法处理条件 if(!empty($action) && method_exists($this->module_obj, $action)) { return $this->module_obj->$action($value, $params); @@ -509,7 +574,7 @@ class FormHandleModule * @date 2020-06-05 * @desc description */ - function BaseWhereHandle() + public function BaseWhereHandle() { // 是否定义基础条件属性 if(property_exists($this->module_obj, 'condition_base') && is_array($this->module_obj->condition_base))