state(array('buy' => 1)); if($info) { $array += $info; } return $array; }; $source = function() { $array = array(); $info = Dever::db('source/info')->state(); if($info) { $array += $info; } return $array; }; $list = array ( # 匹配的正则或函数 选填项 'option' => array ( 'start_day_int' => array('yes-day_int', '>='), 'end_day_int' => array('yes-day_int', '<='), 'source_id' => 'yes', 'journal_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('day_int' => 'desc', 'id' => 'desc'), 'group' => 'day_int', 'page' => array(20, 'list'), 'col' => 'id,pv,uv,user_num,user_yes_num,sum(order_num) as order_num,sum(order_yes_num) as order_yes_num,sum(order_no_num) as order_no_num,sum(buy_num) as buy_num,sum(buy_cash) as buy_cash,cdate,journal_id,source_id,day_int,day_string', ); $search = Dever::input('search_option_journal_id'); if ($search && $search > 0) { unset($list['group']); $list['col'] = 'id,order_num,order_yes_num,order_no_num,buy_num,buy_cash,cdate,journal_id,source_id,day_int,day_string'; } $config = array ( # 表名 'name' => 'source', # 显示给用户看的名称 'lang' => '渠道订单', 'order' => '9', # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', //'list' => true, ), 'day_string' => array ( 'type' => 'varchar-60', 'name' => '统计日期', 'default' => '', 'desc' => '统计日期', 'match' => 'is_string', 'update' => 'text', //'search' => 'fulltext', 'list' => true, ), 'day_int' => array ( 'type' => 'int-11', 'name' => '统计日期', 'default' => '', 'desc' => '统计日期', 'match' => 'is_numeric', 'update' => 'text', 'search' => 'time', 'order' => 'desc', //'list' => true, ), 'source_id' => array ( 'type' => 'int-11', 'name' => '渠道', 'default' => '', 'desc' => '渠道', 'match' => 'is_numeric', 'update' => 'select', 'search' => 'select', 'option' => $source, 'list' => true, ), 'journal_id' => array ( 'type' => 'int-11', 'name' => '小刊', 'default' => '', 'desc' => '小刊', 'match' => 'is_numeric', 'update' => 'select', 'search' => 'select', 'option' => $journal, 'list' => 'Dever::load("stat/lib/manage.info", {journal_id})', ), 'pv' => array ( 'type' => 'int-11', 'name' => 'PV', 'default' => '0', 'match' => '落地页PV', 'match' => 'is_numeric', 'update' => 'text', 'list' => true, ), 'uv' => array ( 'type' => 'int-11', 'name' => 'UV', 'default' => '0', 'match' => '落地页UV', 'match' => 'is_numeric', 'update' => 'text', 'list' => true, ), 'user_num' => array ( 'type' => 'int-11', 'name' => '用户量', 'default' => '0', 'match' => '用户量', 'match' => 'is_numeric', 'update' => 'text', //'list' => true, ), 'user_yes_num' => array ( 'type' => 'int-11', 'name' => '用户量', 'default' => '0', 'match' => '用户授权量', 'match' => 'is_numeric', 'update' => 'text', 'list' => true, ), 'order_num' => array ( 'type' => 'int-11', 'name' => '总订单', 'default' => '0', 'match' => '总订单数', 'match' => 'is_numeric', 'update' => 'text', 'list' => true, ), 'order_yes_num' => array ( 'type' => 'int-11', 'name' => '支付订单', 'default' => '0', 'match' => '支付订单数', 'match' => 'is_numeric', 'update' => 'text', 'list' => true, ), 'order_no_num' => array ( 'type' => 'int-11', 'name' => '未支付订单', 'default' => '0', 'match' => '未支付订单数', 'match' => 'is_numeric', 'update' => 'text', 'list' => true, ), 'buy_num' => array ( 'type' => 'int-11', 'name' => '售出本数', 'default' => '0', 'match' => '售出本数', 'match' => 'is_numeric', 'update' => 'text', 'list' => true, ), 'buy_cash' => array ( 'type' => 'int-11', 'name' => '售出金额', 'default' => '0', 'match' => '售出金额', 'match' => 'is_numeric', 'update' => 'text', '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", {cdate})', ), ), 'manage' => array ( 'insert' => false, 'edit' => false, 'delete' => false, 'num' => false, 'excel' => true, //'page_list' => 'journal', ), 'request' => array ( 'list' => $list, 'getData' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'start' => array('yes-day_int', '>='), 'end' => array('yes-day_int', '<='), 'state' => 1, ), 'type' => 'all', 'order' => array('day_int' => 'desc'), //'group' => 'day_int', 'col' => '*', ), ), ); if ($search && $search > 0) { $config['struct']['pv']['list'] = $config['struct']['uv']['list'] = $config['struct']['user_num']['list'] = $config['struct']['user_yes_num']['list'] = false; } return $config;