123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <?php
- $config = array
- (
- # 表名
- 'name' => 'shop_stat',
- # 显示给用户看的名称
- 'lang' => '门店数据统计',
- 'order' => -11,
- # 数据结构 不同的字段放这里
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- //'list' => true,
- ),
- 'day' => array
- (
- 'type' => 'int-11',
- 'name' => '日期',
- 'default' => '',
- 'match' => 'is_numeric',
- 'desc' => '',
- 'search' => 'sday',
- 'search_buttons' => array
- (
- 'sum' => 'buy_num,buy_cash,sell_num,sell_cash,sl_num',
- 'option' => array(
- 'day' => '按天',
- 'week' => '按周',
- 'month' => '按月',
- ),
- 'group' => 'shop_id',
- ),
- 'order' => 'desc',
- //'list' => 'Dever::showDay("{day}")',
- ),
- 'shop_id' => array
- (
- 'type' => 'int-11',
- 'name' => '门店名称',
- 'default' => '',
- 'desc' => '门店名称',
- 'match' => 'is_numeric',
- 'search' => 'select',
- //'option' => $shop,
- 'update' => 'hidden',
- 'search' => 'hidden',
- 'search' => array
- (
- 'api' => 'shop/info-like',
- 'col' => 'name',
- 'result' => 'id',
- ),
- 'value' => Dever::input('search_option_shop_id'),
- 'list' => 'Dever::load("shop/info-one#name", {shop_id})',
- ),
- 'area' => array
- (
- 'type' => 'varchar-500',
- 'name' => '所在街道',
- 'default' => '',
- 'desc' => '所在街道',
- 'match' => 'option',
- 'search' => 'linkage',
- 'update' => 'linkage',
- 'option' => Dever::url('lib/area.get', 'shop'),
- //'list' => 'Dever::load("area/api.string", "{area}")',
- ),
- 'buy_num' => array
- (
- 'type' => 'int-11',
- 'name' => '采购订单量',
- 'default' => '0',
- 'desc' => '采购订单量',
- 'match' => 'is_numeric',
- 'list' => true,
- ),
- 'buy_cash' => array
- (
- 'type' => 'varchar-100',
- 'name' => '采购金额',
- 'default' => '0',
- 'desc' => '采购金额',
- 'match' => 'is_string',
- 'search' => 'order',
- 'list' => 'round({buy_cash}, 2)',
- ),
- 'sell_num' => array
- (
- 'type' => 'int-11',
- 'name' => '销售订单量',
- 'default' => '0',
- 'desc' => '销售订单量',
- 'match' => 'is_numeric',
- 'list' => true,
- ),
- 'sell_cash' => array
- (
- 'type' => 'varchar-100',
- 'name' => '销售金额',
- 'default' => '0',
- 'desc' => '销售金额',
- 'match' => 'is_string',
- 'search' => 'order',
- 'list' => 'round({sell_cash}, 2)',
- ),
- 'sl_num' => array
- (
- 'type' => 'int-11',
- 'name' => '沙龙消耗商品数量',
- 'default' => '0',
- 'desc' => '沙龙消耗商品数量',
- 'match' => 'is_numeric',
- 'search' => 'order',
- //'list' => true,
- ),
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '数据状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
- ),
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '发布时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- //'search' => 'date',
- //'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'manage' => array
- (
- 'insert' => false,
- 'edit' => false,
- 'delete' => false,
- 'num' => false,
- 'excel' => true,
- ),
- # request 请求接口定义
- 'request' => array
- (
- 'list' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'shop_id' => 'yes',
- 'area' => array('yes', 'like'),
- 'start_day' => array('yes-day', '>='),
- 'end_day' => array('yes-day', '<='),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('day' => 'desc', 'cdate' => 'desc'),
- 'page' => array(20, 'list'),
- 'group' => 'shop_id',
- 'col' => '*,sum(buy_num) as buy_num, sum(buy_cash) as buy_cash, sum(sell_num) as sell_num, sum(sell_cash) as sell_cash, sum(sl_num) as sl_num',
- ),
- ),
- );
- return $config;
|