Files
shopxo/app/index/form/Userintegral.php

174 lines
6.5 KiB
PHP
Raw Permalink Normal View History

2020-06-29 23:00:56 +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-29 23:00:56 +08:00
// +----------------------------------------------------------------------
2021-03-16 10:34:52 +08:00
// | Licensed ( https://opensource.org/licenses/mit-license.php )
2020-06-29 23:00:56 +08:00
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\index\form;
2021-07-18 23:42:10 +08:00
use think\facade\Db;
2020-06-29 23:00:56 +08:00
/**
* 用户积分动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-28
* @desc description
*/
2020-11-14 00:55:18 +08:00
class UserIntegral
2020-06-29 23:00:56 +08:00
{
// 基础条件
public $condition_base = [];
/**
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-29
* @desc description
* @param [array] $params [输入参数]
*/
public function __construct($params = [])
{
// 用户信息
2025-09-23 21:22:38 +08:00
$user_id = empty($params['system_user']) ? 0 : $params['system_user']['id'];
$this->condition_base[] = ['user_id', '=', $user_id];
2020-06-29 23:00:56 +08:00
}
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-28
* @desc description
* @param [array] $params [输入参数]
*/
public function Run($params = [])
{
2023-02-01 22:41:26 +08:00
$lang = MyLang('userintegral.form_table');
2020-06-29 23:00:56 +08:00
return [
// 基础配置
'base' => [
'key_field' => 'id',
'is_search' => 1,
2026-03-04 10:21:47 +08:00
'is_middle' => 0,
2020-06-29 23:00:56 +08:00
],
// 表单配置
'form' => [
[
2026-06-02 16:12:10 +08:00
'label' => $lang['integral_type'],
2020-06-29 23:00:56 +08:00
'view_type' => 'field',
2026-06-02 16:12:10 +08:00
'view_key' => 'integral_type_name',
'is_sort' => 1,
2026-06-02 16:12:10 +08:00
'width' => 130,
2020-06-29 23:00:56 +08:00
'search_config' => [
'form_type' => 'select',
2026-06-02 16:12:10 +08:00
'form_name' => 'integral_type',
2020-06-29 23:00:56 +08:00
'where_type' => 'in',
2026-06-02 16:12:10 +08:00
'data' => MyConst('common_integral_log_integral_type_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => $lang['operation_type'],
'view_type' => 'field',
'view_key' => 'operation_type_name',
'is_color' => 1,
'color_key' => 'operation_type',
'color_style' => [0=>'danger', 1=>'success'],
'is_sort' => 1,
'width' => 130,
'search_config' => [
'form_type' => 'select',
'form_name' => 'operation_type',
'where_type' => 'in',
'data' => MyConst('common_integral_log_operation_type_list'),
2020-06-29 23:00:56 +08:00
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
2023-01-26 17:06:20 +08:00
'label' => $lang['operation_integral'],
2020-06-29 23:00:56 +08:00
'view_type' => 'field',
'view_key' => 'operation_integral',
'is_sort' => 1,
2020-06-29 23:00:56 +08:00
'search_config' => [
'form_type' => 'section',
],
],
[
2023-01-26 17:06:20 +08:00
'label' => $lang['original_integral'],
2020-06-29 23:00:56 +08:00
'view_type' => 'field',
'view_key' => 'original_integral',
'is_sort' => 1,
2020-06-29 23:00:56 +08:00
'search_config' => [
'form_type' => 'section',
],
],
[
2023-01-26 17:06:20 +08:00
'label' => $lang['new_integral'],
2020-06-29 23:00:56 +08:00
'view_type' => 'field',
'view_key' => 'new_integral',
'is_sort' => 1,
2020-06-29 23:00:56 +08:00
'search_config' => [
'form_type' => 'section',
],
],
[
2023-01-26 17:06:20 +08:00
'label' => $lang['msg'],
2020-06-29 23:00:56 +08:00
'view_type' => 'field',
'view_key' => 'msg',
'grid_size' => 'sm',
'is_sort' => 1,
2020-06-29 23:00:56 +08:00
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
2023-01-26 17:06:20 +08:00
'label' => $lang['add_time_time'],
2020-06-29 23:00:56 +08:00
'view_type' => 'field',
'view_key' => 'add_time_time',
'is_sort' => 1,
2020-06-29 23:00:56 +08:00
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'add_time',
],
],
[
2023-01-26 17:06:20 +08:00
'label' => MyLang('operate_title'),
2020-06-29 23:00:56 +08:00
'view_type' => 'operate',
'view_key' => 'userintegral/module/operate',
'align' => 'center',
'fixed' => 'right',
2026-06-02 16:12:10 +08:00
'width' => 80,
2020-06-29 23:00:56 +08:00
],
],
2022-08-02 17:23:10 +08:00
// 数据配置
'data' => [
2026-06-02 16:12:10 +08:00
'table_name' => 'UserIntegralLog',
'data_handle' => 'IntegralService::IntegralLogListHandle',
'detail_where' => $this->condition_base,
'is_fixed_name_field' => 1,
'fixed_name_data' => [
'integral_type' => [
'data' => MyConst('common_integral_log_integral_type_list'),
],
'operation_type' => [
'data' => MyConst('common_integral_log_operation_type_list'),
],
],
2022-08-02 17:23:10 +08:00
],
2020-06-29 23:00:56 +08:00
];
}
}
?>