shopxo/app/index/form/Usergoodsfavor.php
2021-07-18 23:42:10 +08:00

133 lines
4.7 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://opensource.org/licenses/mit-license.php )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\index\form;
use think\facade\Db;
/**
* 用户商品收藏管理动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-30
* @desc description
*/
class UserGoodsFavor
{
// 基础条件
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 = [])
{
// 用户信息
if(!empty($params['system_user']))
{
$this->condition_base[] = ['f.user_id', '=', $params['system_user']['id']];
}
}
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-30
* @desc description
* @param [array] $params [输入参数]
*/
public function Run($params = [])
{
return [
// 基础配置
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('index/usergoodsfavor/index'),
'is_delete' => 1,
'delete_url' => MyUrl('index/usergoodsfavor/delete'),
'delete_key' => 'ids',
],
// 表单配置
'form' => [
[
'view_type' => 'checkbox',
'is_checked' => 0,
'checked_text' => '反选',
'not_checked_text' => '全选',
'align' => 'center',
'width' => 80,
],
[
'label' => '商品信息',
'view_type' => 'module',
'view_key' => 'usergoodsfavor/module/goods',
'grid_size' => 'lg',
'is_sort' => 1,
'sort_field' => 'g.title',
'search_config' => [
'form_type' => 'input',
'form_name' => 'g.title|g.model|g.simple_desc|g.seo_title|g.seo_keywords|g.seo_keywords',
'where_type' => 'like',
'placeholder' => '请输入商品名称/简述/SEO信息'
],
],
[
'label' => '销售价格(元)',
'view_type' => 'field',
'view_key' => 'price',
'is_sort' => 1,
'search_config' => [
'form_type' => 'section',
'form_name' => 'g.min_price',
'is_point' => 1,
],
],
[
'label' => '原价(元)',
'view_type' => 'field',
'view_key' => 'original_price',
'is_sort' => 1,
'search_config' => [
'form_type' => 'section',
'form_name' => 'g.min_original_price',
'is_point' => 1,
],
],
[
'label' => '创建时间',
'view_type' => 'field',
'view_key' => 'add_time',
'is_sort' => 1,
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'f.add_time',
],
],
[
'label' => '操作',
'view_type' => 'operate',
'view_key' => 'usergoodsfavor/module/operate',
'align' => 'center',
'fixed' => 'right',
],
],
];
}
}
?>