vr-shopxo-source/application/form/GoodsForm.php

122 lines
4.0 KiB
PHP
Raw Normal View History

2020-05-20 10:32:23 +00:00
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
2020-05-29 06:03:53 +00:00
namespace app\form;
2020-05-20 10:32:23 +00:00
use think\Db;
/**
* 商品表单
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-05-16
* @desc description
*/
class GoodsForm
{
/**
* 表单
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-05-16
* @desc description
* @param [array] $params [输入参数]
*/
public function Table($params = [])
{
2020-05-29 06:03:53 +00:00
return [
// 基础配置
'base' => [
'key_field' => 'id',
'status_field' => 'is_shelves',
],
// 表单配置
'form' => [
[
'label' => '商品ID',
'view_type' => 'field',
'view_key' => 'id',
],
[
'label' => '商品信息',
'view_type' => 'module',
'view_key' => 'goods/module/info',
'grid_size' => 'lg',
],
[
'label' => '销售价格(元)',
'view_type' => 'field',
'view_key' => 'price',
],
[
'label' => '原价(元)',
'view_type' => 'field',
'view_key' => 'original_price',
],
[
'label' => '库存数量',
'view_type' => 'field',
'view_key' => ['inventory', 'inventory_unit'],
'view_key_join' => ' ',
],
[
'label' => '上下架',
'view_type' => 'status',
'view_key' => 'is_shelves',
'key_field' => 'id',
'post_url' => MyUrl('admin/goods/statusshelves'),
'is_form_su' => 1,
'align' => 'center',
],
[
'label' => '首页推荐',
'view_type' => 'status',
'view_key' => 'is_home_recommended',
'key_field' => 'id',
'post_url' => MyUrl('admin/goods/statushomerecommended'),
'align' => 'center',
],
[
'label' => '商品型号',
'view_type' => 'field',
'view_key' => 'model',
],
[
'label' => '品牌',
'view_type' => 'field',
'view_key' => 'brand_name',
],
[
'label' => '操作',
'view_type' => 'operate',
'view_key' => 'goods/module/operate',
'align' => 'center',
'fixed' => 'right',
],
2020-05-20 10:32:23 +00:00
],
];
}
/**
* 条件
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-05-16
* @desc description
* @param [array] $params [输入参数]
*/
public function Search($params = [])
{
}
}