member.php 33 KB

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