member.php 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125
  1. <?php
  2. $role = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('setting/lib/manage.role');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $status = array
  13. (
  14. 1 => array('name' => '未认证', 'style' => 'font-weight:bold;color:#436EEE'),
  15. 2 => array('name' => '正常', 'style' => 'font-weight:bold;color:green'),
  16. //3 => '驳回',
  17. //4 => '已删除',
  18. 5 => array('name' => '已禁用', 'style' => 'font-weight:bold;color:#CD3700'),
  19. );
  20. $type = array
  21. (
  22. 1 => '个人',
  23. 2 => '公司',
  24. );
  25. $prize_type = array
  26. (
  27. 1 => '名额外',
  28. 2 => '名额内',
  29. );
  30. $is_shop = array
  31. (
  32. 1 => '无法修改',
  33. 2 => '可以修改',
  34. );
  35. $import = array
  36. (
  37. 1 => '最新系统',
  38. 2 => 'v2旧系统导入',
  39. 3 => 'v1旧系统导入',
  40. );
  41. $is_area = array
  42. (
  43. 1 => '是',
  44. 2 => '否',
  45. );
  46. $source_id = function()
  47. {
  48. $array = array
  49. (
  50. -1 => array
  51. (
  52. 'id' => '-1',
  53. 'name' => '无来源',
  54. ),
  55. );
  56. $data = Dever::load('setting/source-state');
  57. if($data)
  58. {
  59. $array += $data;
  60. }
  61. return $array;
  62. };
  63. $level = function()
  64. {
  65. $array = array
  66. (
  67. -1 => array
  68. (
  69. 'id' => -1,
  70. 'name' => '普通',
  71. ),
  72. );
  73. $data = Dever::load('setting/level-state');
  74. if($data)
  75. {
  76. $array += $data;
  77. }
  78. return $array;
  79. };
  80. $excel = false;
  81. if (Dever::load('manage/auth')->checkFunc('agent.member', 'agent_member_excel1', '代理商数据导出')) {
  82. $excel[] = array('代理商数据导出', '代理商列表', 'agent/lib/manage.agentOut');
  83. }
  84. if (Dever::load('manage/auth')->checkFunc('agent.member', 'agent_member_excel12', '代理商资金数据导出')) {
  85. $excel[] = array('代理商资金数据导出', '代理商资金列表', 'agent/lib/manage.agentCashOut');
  86. }
  87. if (Dever::load('manage/auth')->checkFunc('agent.member', 'agent_member_excel13', '代理商直推奖励导出')) {
  88. $excel[] = array('代理商直推奖励导出', '代理商直推奖励列表', 'agent/lib/manage.out_zhitui');
  89. }
  90. if (Dever::load('manage/auth')->checkFunc('agent.member', 'agent_member_excel14', '代理商归店数据导出')) {
  91. $excel[] = array('代理商归店数据导出', '代理商列表', 'agent/lib/manage.agentGuiout');
  92. }
  93. # 权限设置 1是查看详情、2是头衔统计
  94. $search_auth = Dever::input('search_option_dever_auth', 1);
  95. $info = '';
  96. $button = array();
  97. //$button['导入订单'] = array('fast', '', 'import&project=upload&call=agent/lib/manage.import&key=4');
  98. $list_button = array();
  99. if($search_auth == 1){
  100. if(Dever::load('manage/auth')->checkFunc('agent.member', 'chakanxiangqing', '查看详情')){
  101. $list_button['list'] = array('查看详情', '"member_area&mid={id}&page_type=1&[refer]"');
  102. }
  103. }
  104. if($search_auth == 2){
  105. if(Dever::load('manage/auth')->checkFunc('agent.member_title', 'editTitleout', '头衔数据导出')){
  106. $excel[] = array('头衔数据导出', '头衔数据导出', 'agent/lib/member.out_member');
  107. }
  108. if (Dever::load('manage/auth')->checkFunc('agent.member', 'agent_member_excel151', '推荐人头衔导出')) {
  109. $excel[] = array('推荐人头衔导出', '推荐人头衔导出', 'agent/lib/manage.out_touxian');
  110. }
  111. }
  112. if(Dever::load('manage/auth')->checkFunc('agent.member', 'editCardMout', '权益数据导出')){
  113. $excel[] = array('权益数据导出','权益数据导出', 'agent/lib/dhorder.out_equity');
  114. }
  115. $title = function() use($search_auth)
  116. {
  117. $array = array();
  118. if ($search_auth == 2) {
  119. $data = Dever::load('setting/title-getData');
  120. } else {
  121. $data = Dever::load('setting/title-getData', array('id' => 1));
  122. }
  123. if($data)
  124. {
  125. $array += $data;
  126. }
  127. return $array;
  128. };
  129. /*
  130. if (Dever::load('manage/auth')->checkFunc('agent.member', 'edit6', '查看关系图谱')) {
  131. $list_button['list1'] = array('查看关系图谱',Dever::url('lib/manage.relation?mid={id}&[refer].manage', 'agent'));
  132. }
  133. */
  134. $admin = Dever::load('manage/auth.info');
  135. $admin_auth = false;
  136. if ($admin && $admin['role'] == 24){
  137. $admin_auth = $admin['role'];
  138. }
  139. # id小于50000为导入的数据
  140. return array
  141. (
  142. # 表名
  143. 'name' => 'member',
  144. # 显示给用户看的名称
  145. 'lang' => '代理商管理',
  146. 'order' => 100,
  147. 'auto' => 50000,
  148. 'config_type' => $type,
  149. 'config_status' => $status,
  150. 'info' => $info,
  151. # 同步更新另外一个或多个表的多条关联数据,以逗号隔开
  152. 'sync' => array
  153. (
  154. 'agent/member_title' => array
  155. (
  156. # 更新时的条件,另外一个表的字段 => 本表的字段
  157. 'where' => array('mid', 'id'),
  158. # 要更新的数据
  159. 'update' => array('title_id' => 'title_id'),
  160. # 同步更新的类型,delete为先删再插入,update为先查询是否存在,存在直接更新,不存在则插入, only为仅更新
  161. 'type' => 'delete',
  162. )
  163. ),
  164. 'start' => array
  165. (
  166. 'update' => 'agent/lib/manage.updateArea',
  167. ),
  168. # 数据结构
  169. 'struct' => array
  170. (
  171. 'id' => array
  172. (
  173. 'type' => 'int-11',
  174. 'name' => '代理商姓名/手机号',
  175. 'default' => '',
  176. 'desc' => '',
  177. 'match' => 'is_numeric',
  178. 'search' => 'order',
  179. //'list' => true,
  180. 'search_name' => '代理商姓名/手机号',
  181. 'search' => array
  182. (
  183. 'api' => 'agent/member-getSearch',
  184. 'col' => 'col',
  185. 'result' => 'id',
  186. 'search' => 'id',
  187. ),
  188. 'list_name' => '代理商信息',
  189. 'list' => $admin_auth ? 'Dever::load("agent/lib/member.getOne", {id}, "agent/member", true, true)' : ($search_auth == 1 ? 'Dever::load("agent/lib/member.getOne", {id}, "agent/member", true)' : false),
  190. ),
  191. 'name' => array
  192. (
  193. 'type' => 'varchar-100',
  194. 'name' => '代理商姓名',
  195. 'default' => '',
  196. 'desc' => '姓名',
  197. 'match' => 'is_string',
  198. 'update' => 'text',
  199. 'list_name' => $search_auth == 2 ? '姓名': false,
  200. 'list' => $search_auth == 2 ? true : false,
  201. ),
  202. 'rdate' => array
  203. (
  204. 'type' => 'int-11',
  205. 'name' => '认证时间',
  206. 'match' => 'option',
  207. 'default' => '0',
  208. 'desc' => '',
  209. 'update' => 'date',
  210. 'callback' => 'maketime',
  211. 'search' => 'date',
  212. // 'list' => '{rdate} > 0 ? date("Y-m-d H:i", {rdate}) : "无"',
  213. 'list' => $search_auth == 1 ? 'Dever::load("agent/lib/member.set_rdate", {id})' : false,
  214. 'list_order' => 100,
  215. ),
  216. 'udate' => array
  217. (
  218. 'type' => 'int-11',
  219. 'name' => '终审时间',
  220. 'default' => '',
  221. 'match' => 'is_numeric',
  222. 'desc' => '',
  223. 'search' => 'date',
  224. ),
  225. 'avatar' => array
  226. (
  227. 'type' => 'varchar-150',
  228. 'name' => '头像',
  229. 'default' => '',
  230. 'desc' => '请选择头像',
  231. 'match' => 'option',
  232. 'update' => 'image',
  233. 'key' => '1',
  234. //'place' => '150',
  235. ),
  236. 'mobile' => array
  237. (
  238. 'type' => 'bigint-11',
  239. 'name' => '手机号',
  240. 'default' => '',
  241. 'desc' => '请输入手机号',
  242. 'match' => Dever::rule('mobile'),
  243. 'update' => 'text',
  244. //'search' => 'fulltext',
  245. 'list' => $search_auth == 2 ? true : false,
  246. ),
  247. 'email' => array
  248. (
  249. 'type' => 'varchar-150',
  250. 'name' => '邮箱',
  251. 'default' => '',
  252. 'desc' => '请输入邮箱',
  253. 'match' => 'option||' . Dever::rule('email'),
  254. 'update' => 'text',
  255. ),
  256. 'username' => array
  257. (
  258. 'type' => 'varchar-100',
  259. 'name' => '昵称',
  260. 'default' => '',
  261. 'desc' => '昵称',
  262. 'match' => 'is_string',
  263. 'update' => 'text',
  264. ),
  265. 'birthday' => array
  266. (
  267. 'type' => 'int-11',
  268. 'name' => '生日',
  269. 'default' => '',
  270. 'match' => 'option',
  271. 'desc' => '生日',
  272. 'update' => 'time',
  273. 'callback' => 'maketime',
  274. ),
  275. 'password' => array
  276. (
  277. 'type' => 'varchar-50',
  278. 'name' => '密码',
  279. 'default' => '',
  280. 'desc' => '请输入密码',
  281. 'match' => 'option',
  282. 'update' => 'password',
  283. 'callback' => 'sha1',
  284. ),
  285. 'parent_mid' => array
  286. (
  287. 'type' => 'int-11',
  288. 'name' => '推荐人姓名/手机号',
  289. 'default' => '-1',
  290. 'desc' => '邀请人',
  291. 'match' => 'is_string',
  292. //'update' => 'text',
  293. 'search' => $admin_auth ? false : ($search_auth == 1 ? array
  294. (
  295. 'api' => 'agent/member-getSearch',
  296. 'col' => 'col',
  297. 'result' => 'id',
  298. 'search' => 'parent_mid',
  299. ) : false),
  300. 'list_name' => '推荐人信息',
  301. 'list' => $admin_auth ? 'Dever::load("agent/lib/member.getOne", {parent_mid},"agent/member", false, true)' : ($search_auth == 1 ? 'Dever::load("agent/lib/member.getOne", {parent_mid})' : false),
  302. ),
  303. 'source_id' => array
  304. (
  305. 'type' => 'int-11',
  306. 'name' => '注册来源',
  307. 'default' => '-1',
  308. 'desc' => '注册来源',
  309. 'match' => 'is_numeric',
  310. 'search' => 'select',
  311. //'update' => 'checkbox',
  312. 'option' => $source_id,
  313. ),
  314. 'code' => array
  315. (
  316. 'type' => 'varchar-50',
  317. 'name' => '邀请码',
  318. 'default' => '',
  319. 'desc' => '代理商邀请码',
  320. 'match' => 'option',
  321. //'update' => 'text',
  322. 'list_order'=>1,
  323. ),
  324. 'role' => array
  325. (
  326. 'type' => 'int-11',
  327. 'name' => '代理角色',
  328. 'default' => '',
  329. 'desc' => '代理角色',
  330. 'match' => 'is_numeric',
  331. 'search' => 'select',
  332. 'update' => 'select',
  333. 'option' => $role,
  334. 'list' => $search_auth == 2 ? true : false,
  335. ),
  336. 'level_id' => array
  337. (
  338. 'type' => 'int-11',
  339. 'name' => '代理商等级',
  340. 'default' => '-1',
  341. 'desc' => '代理商等级',
  342. 'match' => 'is_numeric',
  343. 'search' => $admin_auth ? false : 'select',
  344. 'update' => 'select',
  345. 'option' => $level,
  346. //'list' => true,
  347. ),
  348. 'title_id' => array
  349. (
  350. 'type' => 'varchar-100',
  351. 'name' => '代理商头衔',
  352. 'default' => '1',
  353. 'desc' => '代理商头衔',
  354. 'match' => 'option',
  355. 'search' => 'selects',
  356. 'update' => 'checkbox',
  357. 'option' => $title,
  358. 'list' => $search_auth == 2 ? true : false,
  359. ),
  360. 'is_area' => array
  361. (
  362. 'type' => 'tinyint-1',
  363. 'name' => '是否有代理区域',
  364. 'default' => '1',
  365. 'desc' => '是否有代理区域',
  366. 'match' => 'is_numeric',
  367. 'option' => $is_area,
  368. 'update' => 'radio',
  369. ),
  370. 'area' => array
  371. (
  372. 'type' => 'varchar-500',
  373. 'name' => '代理区域',
  374. 'default' => '',
  375. 'desc' => '代理区域',
  376. 'match' => 'option',
  377. 'search' => 'linkage',
  378. 'update' => 'linkage',
  379. 'option' => Dever::url('api.get?level_total=4', 'area'),
  380. ),
  381. 'is_shop' => array
  382. (
  383. 'type' => 'tinyint-1',
  384. 'name' => '门店是否可以修改',
  385. 'default' => '2',
  386. 'desc' => '门店是否可以修改',
  387. 'match' => 'is_numeric',
  388. 'option' => $is_shop,
  389. 'update' => 'radio',
  390. ),
  391. 'shop_id' => array
  392. (
  393. 'type' => 'int-11',
  394. 'name' => '所属门店',
  395. 'default' => '',
  396. 'desc' => '所属门店',
  397. 'match' => 'is_numeric',
  398. 'update' => 'select',
  399. 'update_search' => 'shop/lib/manage.search',
  400. ),
  401. 'type' => array
  402. (
  403. 'type' => 'tinyint-1',
  404. 'name' => '类型',
  405. 'default' => '1',
  406. 'desc' => '类型',
  407. 'match' => 'is_numeric',
  408. 'option' => $type,
  409. 'update' => 'radio',
  410. 'control' => 'type',
  411. ),
  412. 'sign' => array
  413. (
  414. 'type' => 'varchar-150',
  415. 'name' => '手写签名',
  416. 'default' => '',
  417. 'desc' => '手写签名',
  418. 'match' => 'option',
  419. 'update' => 'image',
  420. 'key' => '7',
  421. ),
  422. 'idcard' => array
  423. (
  424. 'type' => 'varchar-32',
  425. 'name' => '身份证号码',
  426. 'default' => '',
  427. 'desc' => '身份证号码',
  428. 'match' => Dever::rule('idcard'),
  429. 'update' => 'text',
  430. ),
  431. 'idcard_front' => array
  432. (
  433. 'type' => 'varchar-150',
  434. 'name' => '身份证正面',
  435. 'default' => '',
  436. 'desc' => '身份证正面',
  437. 'match' => 'option',
  438. 'update' => 'image',
  439. 'key' => '8',
  440. //'place' => '660*660',
  441. ),
  442. 'idcard_back' => array
  443. (
  444. 'type' => 'varchar-150',
  445. 'name' => '身份证背面',
  446. 'default' => '',
  447. 'desc' => '身份证背面',
  448. 'match' => 'option',
  449. 'update' => 'image',
  450. 'key' => '8',
  451. //'place' => '660*660',
  452. ),
  453. 'company_name' => array
  454. (
  455. 'type' => 'varchar-100',
  456. 'name' => '公司名称',
  457. 'default' => '',
  458. 'desc' => '公司名称',
  459. 'match' => 'is_string',
  460. 'update' => 'text',
  461. //'search' => 'fulltext',
  462. //'list' => true,
  463. 'show' => 'type=2',
  464. ),
  465. 'company_pic' => array
  466. (
  467. 'type' => 'varchar-150',
  468. 'name' => '营业执照',
  469. 'default' => '',
  470. 'desc' => '营业执照',
  471. 'match' => 'option',
  472. 'update' => 'image',
  473. 'key' => '8',
  474. //'place' => '660*660',
  475. 'show' => 'type=2',
  476. ),
  477. 'company_number' => array
  478. (
  479. 'type' => 'varchar-80',
  480. 'name' => '营业执照号码',
  481. 'default' => '',
  482. 'desc' => '营业执照号码',
  483. 'match' => 'is_string',
  484. 'update' => 'text',
  485. 'show' => 'type=2',
  486. ),
  487. 'address' => array
  488. (
  489. 'type' => 'varchar-800',
  490. 'name' => '地址',
  491. 'default' => '',
  492. 'desc' => '地址',
  493. 'match' => 'is_string',
  494. 'update' => 'text',
  495. ),
  496. 'cash' => array
  497. (
  498. 'type' => 'decimal-11,2',
  499. 'name' => '余额',
  500. 'default' => '0',
  501. 'desc' => '余额',
  502. 'match' => 'is_numeric',
  503. 'search' => $admin_auth ? false : 'exp',
  504. 'update' => 'text',
  505. 'list_name' => $admin_auth ? '余额' : '余额<br />直推业绩<br />团队业绩',
  506. 'list' => $admin_auth ? '"{cash}"' : ($search_auth == 1 ?'"{cash}<br />{sell}<br />{group_sell}"' : false),
  507. ),
  508. 'sell' => array
  509. (
  510. 'type' => 'decimal-11,2',
  511. 'name' => '直推业绩',
  512. 'default' => '0',
  513. 'desc' => '销售业绩',
  514. 'search' => $admin_auth ? false : 'exp',
  515. 'match' => 'is_numeric',
  516. 'update' => 'text',
  517. 'list' => $search_auth == 2 ? true : false,
  518. ),
  519. 'group_sell' => array
  520. (
  521. 'type' => 'decimal-11,2',
  522. 'name' => '团队业绩',
  523. 'default' => '0',
  524. 'desc' => '团队销售业绩',
  525. 'match' => 'is_numeric',
  526. 'search' => $admin_auth ? false : 'exp',
  527. 'update' => 'text',
  528. 'list' => $search_auth == 2 ? true : false,
  529. ),
  530. 'old_group_sell' => array
  531. (
  532. 'type' => 'decimal-11,2',
  533. 'name' => '历史团队业绩',
  534. 'default' => '0',
  535. 'desc' => '历史团队业绩',
  536. 'match' => 'is_numeric',
  537. 'update' => 'text',
  538. 'list_name' => $search_auth == 2 ? '新增业绩' : false,
  539. 'list' => $search_auth == 2 ? 'Dever::load("agent/lib/member.new_money",{id})': false,
  540. ),
  541. 'old_agentdownnum' => array
  542. (
  543. 'type' => 'int-11',
  544. 'name' => '历史直推人数',
  545. 'default' => '0',
  546. 'desc' => '历史团队业绩',
  547. 'match' => 'is_numeric',
  548. 'update' => 'text',
  549. 'list_name' => $search_auth == 2 ? '新增正常业绩' : false,
  550. 'list' => $search_auth == 2 ? 'Dever::load("agent/lib/member.new_zmoney",{id})': false,
  551. ),
  552. 'old_pwd' => array
  553. (
  554. 'type' => 'varchar-32',
  555. 'name' => 'pwd',
  556. 'default' => '',
  557. 'desc' => 'pwd',
  558. 'match' => 'is_string',
  559. 'update' => 'text',
  560. ),
  561. 'old_salt' => array
  562. (
  563. 'type' => 'varchar-32',
  564. 'name' => 'salt',
  565. 'default' => '',
  566. 'desc' => 'salt',
  567. 'match' => 'is_string',
  568. 'update' => 'text',
  569. ),
  570. 'status' => array
  571. (
  572. 'type' => 'tinyint-1',
  573. 'name' => '状态',
  574. 'default' => '1',
  575. 'desc' => '状态',
  576. 'match' => 'is_numeric',
  577. 'option' => $status,
  578. 'search' => 'select',
  579. 'list' => $search_auth == 1 ? true : false,
  580. ),
  581. 'import' => array
  582. (
  583. 'type' => 'tinyint-1',
  584. 'name' => '是否导入',
  585. 'default' => '1',
  586. 'desc' => '是否导入',
  587. 'match' => 'is_numeric',
  588. 'option' => $import,
  589. 'update' => 'radio',
  590. ),
  591. 'prize_type' => array
  592. (
  593. 'type' => 'tinyint-1',
  594. 'name' => '是否名额内',
  595. 'default' => '1',
  596. 'desc' => '是否名额内',
  597. 'match' => 'is_numeric',
  598. 'option' => $prize_type,
  599. ),
  600. 'dever_auth' => array
  601. (
  602. 'name' => '权益兑换时间',
  603. 'default' => '',
  604. 'desc' => '类型',
  605. 'match' => 'is_string',
  606. 'search' => 'hidden,date',
  607. ),
  608. 'dever_time' => array
  609. (
  610. 'name' => '业绩时间',
  611. 'default' => '',
  612. 'desc' => '类型',
  613. 'match' => 'is_string',
  614. // 'search' => 'hidden',
  615. 'search' => $search_auth == 2 ? 'date' : false,
  616. ),
  617. 'idcard_path' => array
  618. (
  619. 'type' => 'varchar-800',
  620. 'name' => '身份证信息',
  621. 'default' => '',
  622. 'desc' => '身份证信息',
  623. 'match' => 'is_string',
  624. 'update' => 'text',
  625. ),
  626. 'reorder' => array
  627. (
  628. 'type' => 'int-11',
  629. 'name' => '排序(数值越大越靠前)',
  630. 'default' => '1',
  631. 'desc' => '请输入排序',
  632. 'match' => 'option',
  633. //'update' => 'text',
  634. //'search' => 'order',
  635. //'list' => true,
  636. //'order' => 'desc',
  637. //'edit' => true,
  638. ),
  639. 'state' => array
  640. (
  641. 'type' => 'tinyint-1',
  642. 'name' => '状态',
  643. 'default' => '1',
  644. 'desc' => '请选择状态',
  645. 'match' => 'is_numeric',
  646. 'update' => 'hidden',
  647. ),
  648. 'cdate' => array
  649. (
  650. 'type' => 'int-11',
  651. 'name' => '加入日期',
  652. 'match' => array('is_numeric', time()),
  653. 'desc' => '',
  654. // 'search' => $search_auth == 2 ? 'date' : false,
  655. # 只有insert时才生效
  656. 'insert' => true,
  657. //'search' => 'date',
  658. ),
  659. ),
  660. 'alter' => array
  661. (
  662. 5 => array
  663. (
  664. array('update', 'cash', 'cash', 'decimal-11,2 0 余额'),
  665. array('update', 'sell', 'sell', 'decimal-11,2 0 直推业绩'),
  666. array('update', 'group_sell', 'group_sell', 'decimal-11,2 0 团队业绩'),
  667. array('update', 'old_group_sell', 'old_group_sell', 'decimal-11,2 0 历史团队业绩'),
  668. ),
  669. 6 => array
  670. (
  671. array('update', 'title_id', 'title_id', 'varchar-100 1 代理商头衔'),
  672. ),
  673. 'version' => 6,
  674. ),
  675. 'index' => array
  676. (
  677. 1 => array
  678. (
  679. 'parent_mid' => 'parent_mid',
  680. ),
  681. # 版本号 更改版本号会更新当前表的索引
  682. 'version' => 1,
  683. ),
  684. 'manage' => array
  685. (
  686. //'list_table' => 'js',
  687. 'insert' => false,
  688. 'delete' => false,
  689. 'edit' => false,
  690. 'excel' => $excel,
  691. 'button' => $button,
  692. 'list_button' => $list_button,
  693. ),
  694. 'request' => array
  695. (
  696. 'getInfo' => array
  697. (
  698. # 匹配的正则或函数 选填项
  699. 'option' => array
  700. (
  701. 'status' => 2,
  702. 'state' => 1,
  703. ),
  704. 'order' => array('id' => 'desc'),
  705. 'type' => 'one',
  706. 'col' => '*',
  707. ),
  708. 'getData' => array
  709. (
  710. # 匹配的正则或函数 选填项
  711. 'option' => array
  712. (
  713. 'idcard' => 'yes',
  714. 'id' => array('yes', '!='),
  715. 'status' => array('yes', 'in'),
  716. 'state' => 1,
  717. ),
  718. 'order' => array('id' => 'desc'),
  719. 'type' => 'all',
  720. 'page' => array(20, 'list'),
  721. 'col' => '*',
  722. ),
  723. 'upCash' => array
  724. (
  725. 'type' => 'update',
  726. 'where' => array
  727. (
  728. 'id' => 'yes',
  729. ),
  730. 'set' => array
  731. (
  732. 'cash' => array('yes', '+='),
  733. ),
  734. ),
  735. 'upSell' => array
  736. (
  737. 'type' => 'update',
  738. 'where' => array
  739. (
  740. 'id' => 'yes',
  741. ),
  742. 'set' => array
  743. (
  744. 'cash' => array('yes', '+='),
  745. 'upcol' => array('yes-sell', '+='),
  746. 'level_id' => 'yes',
  747. ),
  748. ),
  749. 'upGroupSell' => array
  750. (
  751. 'type' => 'update',
  752. 'where' => array
  753. (
  754. 'id' => 'yes',
  755. ),
  756. 'set' => array
  757. (
  758. 'cash' => array('yes', '+='),
  759. 'upcol' => array('yes-group_sell', '+='),
  760. 'level_id' => 'yes',
  761. ),
  762. ),
  763. 'upGroupSellOne' => array
  764. (
  765. 'type' => 'update',
  766. 'where' => array
  767. (
  768. 'id' => 'yes',
  769. ),
  770. 'set' => array
  771. (
  772. 'sell' => array('yes', '+='),
  773. 'group_sell' => array('yes', '+='),
  774. ),
  775. ),
  776. # 获取订单数量
  777. 'getNum' => array
  778. (
  779. # 匹配的正则或函数 选填项
  780. 'option' => array
  781. (
  782. 'start' => array('yes-cdate', '>='),
  783. 'end' => array('yes-cdate', '<='),
  784. 'fstart' => array('yes-rdate', '>='),
  785. 'fend' => array('yes-rdate', '<='),
  786. 'status' => 'yes',
  787. 'role' => 'yes',
  788. 'parent_mid' =>'yes',
  789. 'state' => 1,
  790. ),
  791. 'type' => 'count',
  792. 'col' => '*',
  793. ),
  794. # 获取余额
  795. 'getCash' => array
  796. (
  797. # 匹配的正则或函数 选填项
  798. 'option' => array
  799. (
  800. 'start' => array('yes-cdate', '>='),
  801. 'end' => array('yes-cdate', '<='),
  802. 'fstart' => array('yes-rdate', '>='),
  803. 'fend' => array('yes-rdate', '<='),
  804. 'status' => 'yes',
  805. 'role' => 'yes',
  806. 'parent_mid' =>'yes',
  807. 'state' => 1,
  808. ),
  809. 'type' => 'one',
  810. 'col' => 'sum(cash) as total',
  811. ),
  812. 'getSearch' => array
  813. (
  814. # 匹配的正则或函数 选填项
  815. 'option' => array
  816. (
  817. 'col' => array('yes-mobile,name', 'like'),
  818. ),
  819. 'type' => 'all',
  820. 'col' => '*|id',
  821. ),
  822. 'getShopAll' => array
  823. (
  824. # 匹配的正则或函数 选填项
  825. 'option' => array
  826. (
  827. 'shop_id' => array('yes','>='),
  828. 'state' => 1,
  829. ),
  830. 'type' => 'all',
  831. 'col' => '*',
  832. ),
  833. 'getCount' => array
  834. (
  835. # 匹配的正则或函数 选填项
  836. 'option' => array
  837. (
  838. 'id' => 'yes',
  839. 'role' => array('yes','in'),
  840. 'prize_type' => 'yes',
  841. 'state' => 1,
  842. ),
  843. 'type' => 'count',
  844. 'col' => '*',
  845. ),
  846. 'getOutAll' => array
  847. (
  848. # 匹配的正则或函数 选填项
  849. 'option' => array
  850. (
  851. 'id' => 'yes',
  852. 'role' => 'yes',
  853. 'prize_type' => 'yes',
  854. 'state' => 1,
  855. ),
  856. 'type' => 'all',
  857. 'col' => '*',
  858. ),
  859. 'getCountByRole' => array
  860. (
  861. # 匹配的正则或函数 选填项
  862. 'option' => array
  863. (
  864. 'role' => 'yes',
  865. 'parent_mid' => 'yes',
  866. 'status' => 2,
  867. 'state' => 1,
  868. ),
  869. 'type' => 'count',
  870. 'col' => '*',
  871. ),
  872. 'search' => array
  873. (
  874. 'option' => array
  875. (
  876. 'ids' => array('yes-id', 'in'),
  877. 'name' => array('yes-name,mobile', 'like'),
  878. 'id' => 'yes',
  879. 'state' => 1,
  880. ),
  881. 'type' => 'all',
  882. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  883. 'limit' => '0,20',
  884. 'col' => 'concat(name, "(", mobile , ")") as name, id, id as value, "" as selected, "" as disabled|id',
  885. ),
  886. 'getAll' => array
  887. (
  888. # 匹配的正则或函数 选填项
  889. 'option' => array
  890. (
  891. 'start' => array('yes-rdate', '>='),
  892. 'end' => array('yes-rdate', '<='),
  893. 'status' => 'yes',
  894. 'state' => 1,
  895. ),
  896. 'type' => 'all',
  897. // 'limit' => 10,
  898. 'page' => array(20, 'list'),
  899. 'col' => 'id,name,mobile,idcard,role,group_sell',
  900. ),
  901. 'getNewParent' => array
  902. (
  903. # 匹配的正则或函数 选填项
  904. 'option' => array
  905. (
  906. 'start' => array('yes-rdate','>='),
  907. 'end' => array('yes-rdate','<='),
  908. 'parent_mid' => 'yes',
  909. 'state' => 1,
  910. ),
  911. 'type' => 'all',
  912. 'col' => 'id,group_sell,sell',
  913. ),
  914. 'getNewMember' => array
  915. (
  916. # 匹配的正则或函数 选填项
  917. 'option' => array
  918. (
  919. 'parent_mid' => 'yes',
  920. 'state' => 1,
  921. ),
  922. 'type' => 'all',
  923. 'order' => array('group_sell'=>'desc'),
  924. 'col' => 'id,group_sell,sell',
  925. ),
  926. 'getDataByArea' => array
  927. (
  928. # 匹配的正则或函数 选填项
  929. 'option' => array
  930. (
  931. 'area' => array('yes', 'like'),
  932. 'state' => 1,
  933. ),
  934. 'order' => array('id' => 'desc'),
  935. 'type' => 'all',
  936. 'col' => '*',
  937. ),
  938. 'getDataByRole' => array
  939. (
  940. # 匹配的正则或函数 选填项
  941. 'option' => array
  942. (
  943. 'role' => array('yes', 'in'),
  944. 'state' => 1,
  945. ),
  946. 'order' => array('id' => 'desc'),
  947. 'type' => 'all',
  948. 'col' => '*',
  949. ),
  950. 'getExcelAll' => array
  951. (
  952. # 匹配的正则或函数 选填项
  953. 'option' => array
  954. (
  955. 'start' => array('yes-rdate','>='),
  956. 'end' => array('yes-rdate','<='),
  957. 'area' => array('yes','like'),
  958. 'role' =>'yes',
  959. 'source_id' => 'yes',
  960. 'title_id' =>'yes',
  961. 'level_id' => 'yes',
  962. 'id' => 'yes',
  963. 'state' => 1,
  964. 'status' => 'yes',
  965. ),
  966. 'type' => 'all',
  967. 'col' => '*',
  968. ),
  969. 'getAreaAll' => array
  970. (
  971. # 匹配的正则或函数 选填项
  972. 'option' => array
  973. (
  974. 'area' => 'yes',
  975. 'role' => 'yes',
  976. 'state' => 1,
  977. ),
  978. // 'order' => array('id' => 'desc'),
  979. 'type' => 'one',
  980. 'col' => 'id',
  981. ),
  982. 'getOne' => array
  983. (
  984. # 匹配的正则或函数 选填项
  985. 'option' => array
  986. (
  987. 'role' => 'yes',
  988. 'area' => 'yes',
  989. 'status' => 2,
  990. 'state' => 1,
  991. ),
  992. 'type' => 'one',
  993. 'col' => '*',
  994. ),
  995. 'guidian' => array
  996. (
  997. # 匹配的正则或函数 选填项
  998. 'option' => array
  999. (
  1000. 'role' => 'yes',
  1001. 'start' => array('yes-cdate','>='),
  1002. 'parent_mid' => 'yes',
  1003. 'prize_type' => 'yes',
  1004. 'state' => 1,
  1005. ),
  1006. 'type' => 'all',
  1007. 'col' => '*',
  1008. ),
  1009. 'getDataByName' => array
  1010. (
  1011. # 匹配的正则或函数 选填项
  1012. 'option' => array
  1013. (
  1014. 'name' =>'yes',
  1015. 'state' => 1,
  1016. ),
  1017. 'type' => 'all',
  1018. 'order' => array('role' => 'asc', 'id' => 'desc'),
  1019. 'col' => '*',
  1020. ),
  1021. 'getDataByShop' => array
  1022. (
  1023. # 匹配的正则或函数 选填项
  1024. 'option' => array
  1025. (
  1026. 'shop_id' => 'yes',
  1027. 'status' => 'yes',
  1028. 'state' => 1,
  1029. ),
  1030. 'type' => 'all',
  1031. 'order' => array('id' => 'desc'),
  1032. 'col' => '*|id',
  1033. ),
  1034. ),
  1035. );