123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- <?php
- $button = array();
- $excel = false;
- if (Dever::load('manage/auth')->checkFunc('bill.shop_stat', 'editSout', '导出数据')) {
- $excel[] = array('数据导出','归店数据统计','bill/lib/manage.out_shop_stat');
- }
- $shop = function()
- {
- $array = array();
- $data = Dever::db('shop/info-state');
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $cash_status = array
- (
- 1 => '已发放',
- 2 => '未发放',
- );
- $status = array
- (
- 1 => '已确认',
- 2 => '未确认',
- );
- $list_button = array();
- $list_button['list1'] = array('归店明细', 'member_shop_log&project=agent&menu=agent&search_option_state=1&menu_id=306&search_option_new_shop_id={shop_id}&search_option_dever_auth=2&search_option_status=1');
- $list_button['list2'] = array('直推明细', 'order&project=agent&menu=agent&search_option_state=1&menu_id=306&search_in_parent_mid={mids}');
- $table = Dever::input('table');
- if ($table == 'shop_stat') {
- $month = Dever::input('search_option_month', date('Y-m'));
- if ($month) {
- Dever::setInput('search_option_month', $month);
- }
-
- $button['一键生成归店信息'] = array('oper', 'bill/?l=lib/Cron.shop_stat&day=' . $month, '确认生成归店统计信息吗?');
- $button['重新生成归店信息'] = array('oper', 'bill/?l=lib/Cron.shop_stat&day=' . $month, '确认生成归店统计信息吗?');
- if (Dever::load('manage/auth')->checkFunc('bill.shop_stat', 'duizhang', '对账确认')) {
- $button['对账确认'] = array('oper', 'bill/?l=lib/cron.shopYes_commit&month=' . $month, '确定已完成对账?');
- }
-
- if (Dever::load('manage/auth')->checkFunc('bill.shop_stat', 'fafang', '确认发放')) {
- $button['确认发放'] = array('oper', 'bill/?l=lib/cron.areaCash_commit&month=' . $month, '确认发放资金到代理商账户吗?确认后无法手动恢复');
- }
- }
- $config = array
- (
- # 表名
- 'name' => 'shop_stat',
- # 显示给用户看的名称
- 'lang' => '归店统计',
- 'order' => -10,
- 'info' => '代理商总数=创V数+代理商数量,创V数包含名额外创V数,创V数减去名额外创V就是名额内创V数,代理商数量包含创客数',
- 'end' => array
- (
- 'list' => 'bill/lib/cron.getShopInfo',
- ),
- # 数据结构 不同的字段放这里
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- //'list' => true,
- ),
- 'month' => array
- (
- 'type' => 'int-11',
- 'name' => '月份',
- 'default' => '',
- 'match' => 'is_numeric',
- 'desc' => '',
- 'search' => 'month_eq',
- // 'list_name' => '月份',
- 'search_default' => '',
- 'list_name' => '月份',
- 'list' => 'is_numeric("{month}") ? date("Y-m", "{month}") : "{month}"',
- ),
- 'mids' => array
- (
- 'type' => 'text-255',
- 'name' => '代理商id',
- 'default' => '',
- 'desc' => '代理商id',
- 'match' => 'is_numeric',
- // 'option' => $shop,
- // 'list' => true,
- //'list_order' => 6,
- ),
- 'month_mids' => array
- (
- 'type' => 'text-255',
- 'name' => '代理商id',
- 'default' => '',
- 'desc' => '代理商id',
- 'match' => 'is_numeric',
- // 'option' => $shop,
- // 'list' => true,
- //'list_order' => 6,
- ),
- 'shop_id' => array
- (
- 'type' => 'int-11',
- 'name' => '店铺名称/店铺编号',
- 'default' => '',
- 'desc' => '店铺名称',
- 'match' => 'is_numeric',
- 'option' => $shop,
- 'search' => array
- (
- 'api' => 'shop/info-getSearch',
- 'col' => 'col',
- 'result' => 'id',
- ) ,
- 'list_name' => '门店名称<br/>门店编号<br/>所属代理商',
- 'list' => 'Dever::load("bill/lib/manage.shop_stat", {id})',
- 'list_order' => 2,
- ),
- 'dl_subsidy' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '区域招商补贴',
- 'default' => '0',
- 'desc' => '补贴',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'list' => true,
- 'list_order' => 3,
- ),
- 'v_subsidy' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '名额外创V补贴',
- 'default' => '0',
- 'desc' => '补贴',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'list' => true,
- 'list_order' => 3,
- ),
- 'c_money' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '采购金额',
- 'default' => '0',
- 'desc' => '采购金额',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'list' => true,
- 'list_order' => 3,
- ),
- 'num' => array
- (
- 'type' => 'int-11',
- 'name' => '代理商总数量',
- 'default' => '0',
- 'desc' => '代理商总数量',
- 'match' => 'is_numeric',
- 'search' => 'order',
- // 'list' => true,
- ),
- 'dl_num' => array
- (
- 'type' => 'int-11',
- 'name' => '代理商<br/>数量-除掉创v的数量',
- 'default' => '0',
- 'desc' => '代理商数量',
- 'match' => 'is_numeric',
- // 'search' => 'order',
- 'list' => true,
- 'list_order' => 4,
- ),
- 'ck_num' => array
- (
- 'type' => 'int-11',
- 'name' => '创客数',
- 'default' => '0',
- 'desc' => '创客数',
- 'match' => 'is_numeric',
- // 'search' => 'order',
- 'list' => true,
- 'list_order' => 5,
- ),
- 'v_num' => array
- (
- 'type' => 'int-11',
- 'name' => '创V数',
- 'default' => '0',
- 'desc' => '创V总数量',
- 'match' => 'is_numeric',
- // 'search' => 'order',
- 'list' => true,
- 'list_order' => 6,
- ),
- 'out_num' => array
- (
- 'type' => 'int-11',
- 'name' => '名额外创V数',
- 'default' => '0',
- 'desc' => '创V名额外数量',
- 'match' => 'is_numeric',
- // 'search' => 'order',
- 'list' => true,
- 'list_order' => 7,
- ),
- 'money' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '代理商的总业绩',
- 'default' => '0',
- 'desc' => '代理商的总业绩',
- 'match' => 'is_numeric',
- 'update' => 'text',
- // 'list' => true,
- ),
- 'dl_money' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '归店业绩<br/>(除创V)',
- 'default' => '0',
- 'desc' => '代理商业绩',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'list' => true,
- 'list_order' => 4,
- ),
- 'v_money' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '创V总业绩',
- 'default' => '0',
- 'desc' => '创V总业绩',
- 'match' => 'is_numeric',
- 'update' => 'text',
- // 'list' => true,
- ),
- 'out_money' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '名额外创V<br/>业绩',
- 'default' => '0',
- 'desc' => '创V名额外业绩',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'list' => true,
- 'list_order' => 8,
- ),
- 'nei_money' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '名额内创V<br/>业绩',
- 'default' => '0',
- 'desc' => '创V名额内业绩',
- 'match' => 'is_numeric',
- 'update' => 'text',
- // 'list' => true,
- // 'list_order' => 9,
- ),
- 'status' => array
- (
- 'type' => 'int-11',
- 'name' => '确认状态',
- 'default' => '2',
- 'desc' => '确认状态',
- 'match' => 'is_numeric',
- 'option' => $status,
- 'list' => true,
- ),
- 'cash_status' => array
- (
- 'type' => 'int-11',
- 'name' => '发放状态',
- 'default' => '2',
- 'desc' => '发放状态',
- 'match' => 'is_numeric',
- 'option' => $cash_status,
- '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,
- 'excel' => $excel,
- 'button' => $button,
- 'list_button' => $list_button,
- // (
- // 'new' => array('查看明细', '"lib/manage.guidian?id={id}"', 'bill'),
- // ),
-
- ),
- # request 请求接口定义
- 'request' => array
- (
- 'getState' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'start' => array('yes-month', '>='),
- 'end' => array('yes-month', '<='),
- 'shop_id' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'col' => '*',
- ),
- ),
- );
- return $config;
|