member.php 33 KB

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