member.php 34 KB

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