shopxo/app/admin/form/Orderaftersale.php

332 lines
13 KiB
PHP
Raw Normal View History

2020-06-08 17:31:16 +08:00
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
2021-03-16 10:34:52 +08:00
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
2020-06-08 17:31:16 +08:00
// +----------------------------------------------------------------------
2021-03-16 10:34:52 +08:00
// | Licensed ( https://opensource.org/licenses/mit-license.php )
2020-06-08 17:31:16 +08:00
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\admin\form;
2021-07-18 23:42:10 +08:00
use think\facade\Db;
2020-06-08 17:31:16 +08:00
/**
* 订单售后动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-08
* @desc description
*/
2020-11-14 00:55:18 +08:00
class OrderAftersale
2020-06-08 17:31:16 +08:00
{
// 基础条件
public $condition_base = [];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-08
* @desc description
* @param [array] $params [输入参数]
*/
public function Run($params = [])
{
2023-02-02 23:54:37 +08:00
$lang = MyLang('orderaftersale.form_table');
2020-06-08 17:31:16 +08:00
return [
// 基础配置
'base' => [
'key_field' => 'id',
'is_search' => 1,
'is_middle' => 0,
2020-06-08 17:31:16 +08:00
],
// 表单配置
'form' => [
[
2023-02-02 23:54:37 +08:00
'label' => $lang['goods'],
2020-06-08 17:31:16 +08:00
'view_type' => 'module',
2020-07-07 18:58:29 +08:00
'view_key' => 'orderaftersale/module/goods',
2020-06-08 17:31:16 +08:00
'grid_size' => 'lg',
'is_sort' => 1,
'sort_field' => 'goods_id',
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'input',
'form_name' => 'id',
'where_type_custom' => 'in',
2020-08-20 23:38:41 +08:00
'where_value_custom' => 'WhereBaseGoodsInfo',
2023-02-02 23:54:37 +08:00
'placeholder' => $lang['goods_placeholder'],
2020-06-08 17:31:16 +08:00
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['user'],
2020-06-08 17:31:16 +08:00
'view_type' => 'module',
2020-06-27 22:48:16 +08:00
'view_key' => 'lib/module/user',
2020-06-08 17:31:16 +08:00
'grid_size' => 'sm',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'input',
'form_name' => 'user_id',
'where_type_custom' => 'in',
2020-08-20 23:38:41 +08:00
'where_value_custom' => 'WhereValueUserInfo',
2023-02-02 23:54:37 +08:00
'placeholder' => $lang['user_placeholder'],
2020-06-08 17:31:16 +08:00
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['status'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
2020-07-02 22:42:01 +08:00
'view_key' => 'status',
'view_data_key' => 'name',
2023-08-27 16:59:15 +08:00
'view_data' => MyConst('common_order_aftersale_status_list'),
2020-06-08 17:31:16 +08:00
'width' => 120,
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
2023-08-27 16:59:15 +08:00
'data' => MyConst('common_order_aftersale_status_list'),
2020-06-08 17:31:16 +08:00
'data_key' => 'value',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['type'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
2020-07-02 22:42:01 +08:00
'view_key' => 'type',
'view_data_key' => 'name',
2023-08-27 16:59:15 +08:00
'view_data' => MyConst('common_order_aftersale_type_list'),
2020-06-08 17:31:16 +08:00
'width' => 120,
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
2023-08-27 16:59:15 +08:00
'data' => MyConst('common_order_aftersale_type_list'),
2020-06-08 17:31:16 +08:00
'data_key' => 'value',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['reason'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
'view_key' => 'reason',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['price'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
'view_key' => 'price',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'section',
'is_point' => 1,
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['number'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
'view_key' => 'number',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'section',
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['msg'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
'view_key' => 'msg',
2020-06-30 23:32:16 +08:00
'grid_size' => 'sm',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['refundment'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
2020-07-02 22:42:01 +08:00
'view_key' => 'refundment',
'view_data_key' => 'name',
2023-08-27 16:59:15 +08:00
'view_data' => MyConst('common_order_aftersale_refundment_list'),
2020-06-08 17:31:16 +08:00
'width' => 120,
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
2023-08-27 16:59:15 +08:00
'data' => MyConst('common_order_aftersale_refundment_list'),
2020-06-08 17:31:16 +08:00
'data_key' => 'value',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['voucher'],
2020-06-08 17:31:16 +08:00
'view_type' => 'module',
'view_key' => 'orderaftersale/module/voucher',
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['express_name'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
'view_key' => 'express_name',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['express_number'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
'view_key' => 'express_number',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['refuse_reason'],
'view_type' => 'field',
'view_key' => 'refuse_reason',
'grid_size' => 'sm',
'is_sort' => 1,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
2020-06-08 17:31:16 +08:00
[
2023-02-02 23:54:37 +08:00
'label' => $lang['apply_time'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
2023-01-26 17:06:20 +08:00
'view_key' => 'apply_time',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'apply_time',
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['confirm_time'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
2023-01-26 17:06:20 +08:00
'view_key' => 'confirm_time',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'confirm_time',
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['delivery_time'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
2023-01-26 17:06:20 +08:00
'view_key' => 'delivery_time',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'delivery_time',
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['audit_time'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
2023-01-26 17:06:20 +08:00
'view_key' => 'audit_time',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'audit_time',
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['add_time'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
2023-01-26 17:06:20 +08:00
'view_key' => 'add_time',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'add_time',
],
],
[
2023-02-02 23:54:37 +08:00
'label' => $lang['upd_time'],
2020-06-08 17:31:16 +08:00
'view_type' => 'field',
2023-01-26 17:06:20 +08:00
'view_key' => 'upd_time',
'is_sort' => 1,
2020-06-08 17:31:16 +08:00
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'upd_time',
],
],
[
2023-01-26 17:06:20 +08:00
'label' => MyLang('operate_title'),
2020-06-08 17:31:16 +08:00
'view_type' => 'operate',
'view_key' => 'orderaftersale/module/operate',
'align' => 'center',
'fixed' => 'right',
],
],
2022-08-02 17:23:10 +08:00
// 数据配置
'data' => [
'table_name' => 'OrderAftersale',
'data_handle' => 'OrderAftersaleService::OrderAftersaleListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'user_type' => 'admin',
],
],
2020-06-08 17:31:16 +08:00
];
}
/**
* 用户信息条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-08
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
public function WhereValueUserInfo($value, $params = [])
{
if(!empty($value))
{
// 获取用户 id
2023-08-27 16:59:15 +08:00
$ids = Db::name('User')->where('number_code|username|nickname|mobile|email', 'like', '%'.$value.'%')->column('id');
2020-06-08 17:31:16 +08:00
// 避免空条件造成无效的错觉
return empty($ids) ? [0] : $ids;
}
return $value;
}
/**
2020-07-25 00:13:18 +08:00
* 基础条件处理
2020-06-08 17:31:16 +08:00
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-08
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
2020-07-25 00:13:18 +08:00
public function WhereBaseGoodsInfo($value, $params = [])
2020-06-08 17:31:16 +08:00
{
if(!empty($value))
{
// 获取订单详情搜索的订单售后 id
2023-09-17 22:54:33 +08:00
$ids = Db::name('OrderAftersale')->alias('oa')->join('order_detail od', 'oa.order_detail_id=od.id')->whereOr('od.title|od.model', 'like', '%'.$value.'%')->whereOr('oa.order_id|oa.order_no', '=', $value)->column('oa.id');
2020-06-08 17:31:16 +08:00
// 避免空条件造成无效的错觉
return empty($ids) ? [0] : $ids;
}
return $value;
}
}
?>