user.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. // 初始化表格参数配置
  5. Table.api.init({
  6. extend: {
  7. index_url: 'user/user/index' + location.search,
  8. add_url: 'user/user/add',
  9. edit_url: 'user/user/edit',
  10. // del_url: 'user/user/del',
  11. multi_url: 'user/user/multi',
  12. import_url: 'user/user/import',
  13. table: 'user',
  14. }
  15. });
  16. var table = $("#table");
  17. // 初始化表格
  18. table.bootstrapTable({
  19. url: $.fn.bootstrapTable.defaults.extend.index_url,
  20. pk: 'id',
  21. sortName: 'id',
  22. // fixedColumns: true,
  23. // fixedRightNumber: 1,
  24. columns: [
  25. [
  26. {checkbox: true},
  27. {field: 'id', title: __('Id')},
  28. // {field: 'group_id', title: __('Group_id')},
  29. {field: 'username', title: __('Username'), operate: 'LIKE'},
  30. {field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
  31. // {field: 'password', title: __('Password'), operate: 'LIKE'},
  32. // {field: 'salt', title: __('Salt'), operate: 'LIKE'},
  33. // {field: 'email', title: __('Email'), operate: 'LIKE'},
  34. {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
  35. {field: 'userwallet.score', title: __('Userwallet.score'), operate: false},
  36. {field: 'userwallet.shouyi', title: __('Userwallet.shouyi'), operate: false},
  37. // {field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
  38. // {field: 'level', title: __('Level')},
  39. // {field: 'gender', title: __('Gender')},
  40. // {field: 'birthday', title: __('Birthday'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  41. // {field: 'bio', title: __('Bio'), operate: 'LIKE'},
  42. // {field: 'money', title: __('Money'), operate:'BETWEEN'},
  43. // {field: 'score', title: __('Score')},
  44. // {field: 'successions', title: __('Successions')},
  45. // {field: 'maxsuccessions', title: __('Maxsuccessions')},
  46. // {field: 'prevtime', title: __('Prevtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  47. // {field: 'logintime', title: __('Logintime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  48. // {field: 'loginip', title: __('Loginip'), operate: 'LIKE'},
  49. // {field: 'loginfailure', title: __('Loginfailure')},
  50. // {field: 'joinip', title: __('Joinip'), operate: 'LIKE'},
  51. {field: 'jointime', title: __('Jointime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  52. // {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  53. // {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  54. // {field: 'token', title: __('Token'), operate: 'LIKE'},
  55. {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
  56. // {field: 'verification', title: __('Verification'), operate: 'LIKE'},
  57. // {field: 'mini_openid', title: __('Mini_openid'), operate: 'LIKE'},
  58. // {field: 'mini_sessionkey', title: __('Mini_sessionkey'), operate: 'LIKE'},
  59. // {field: 'unionid', title: __('Unionid'), operate: 'LIKE'},
  60. {field: 'introcode', title: __('Introcode'), operate: 'LIKE'},
  61. // {field: 'last_paytime', title: __('Last_paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  62. // {field: 'intro_num', title: __('Intro_num')},
  63. // {field: 'intro_num_all', title: __('Intro_num_all')},
  64. {field: 'intro_uid', title: __('Intro_uid')},
  65. // {field: 'intro_ids', title: __('Intro_ids')},
  66. // {field: 'intro_level', title: __('Intro_level')},
  67. {field: 'operate', title: __('Operate'),table: table,
  68. buttons:[
  69. {
  70. name:'scoreadd',
  71. text:'增加积分',
  72. title:'增加积分',
  73. icon:'fa fa-exclamation-circle',
  74. classname:'btn btn-xs btn-info btn-dialog',
  75. url:'user/user/scoreadd/id/{ids}?dialog=1',
  76. target:'_self',
  77. /*hidden:function(row){
  78. return row.status==100 ? false : false;
  79. }*/
  80. },
  81. {
  82. name:'shouyiadd',
  83. text:'增加收益',
  84. title:'增加收益',
  85. icon:'fa fa-exclamation-circle',
  86. classname:'btn btn-xs btn-info btn-dialog',
  87. url:'user/user/shouyiadd/id/{ids}?dialog=1',
  88. target:'_self',
  89. /*hidden:function(row){
  90. return row.status==100 ? false : false;
  91. }*/
  92. }
  93. ],
  94. events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  95. ]
  96. ]
  97. });
  98. // 为表格绑定事件
  99. Table.api.bindevent(table);
  100. },
  101. indexguoqi: function () {
  102. // 初始化表格参数配置
  103. Table.api.init({
  104. extend: {
  105. index_url: 'user/user/indexguoqi' + location.search,
  106. multi_url: 'user/user/multi',
  107. import_url: 'user/user/import',
  108. table: 'user',
  109. }
  110. });
  111. var table = $("#table");
  112. // 初始化表格
  113. table.bootstrapTable({
  114. url: $.fn.bootstrapTable.defaults.extend.index_url,
  115. pk: 'id',
  116. sortName: 'id',
  117. // fixedColumns: true,
  118. // fixedRightNumber: 1,
  119. search:false,
  120. showToggle: false,
  121. showColumns: false,
  122. commonSearch:false,
  123. columns: [
  124. [
  125. {checkbox: true},
  126. {field: 'id', title: __('Id')},
  127. // {field: 'group_id', title: __('Group_id')},
  128. {field: 'username', title: __('Username'), operate: 'LIKE'},
  129. {field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
  130. // {field: 'password', title: __('Password'), operate: 'LIKE'},
  131. // {field: 'salt', title: __('Salt'), operate: 'LIKE'},
  132. // {field: 'email', title: __('Email'), operate: 'LIKE'},
  133. {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
  134. // {field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
  135. // {field: 'level', title: __('Level')},
  136. // {field: 'gender', title: __('Gender')},
  137. // {field: 'birthday', title: __('Birthday'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  138. // {field: 'bio', title: __('Bio'), operate: 'LIKE'},
  139. // {field: 'money', title: __('Money'), operate:'BETWEEN'},
  140. // {field: 'score', title: __('Score')},
  141. // {field: 'successions', title: __('Successions')},
  142. // {field: 'maxsuccessions', title: __('Maxsuccessions')},
  143. // {field: 'prevtime', title: __('Prevtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  144. // {field: 'logintime', title: __('Logintime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  145. // {field: 'loginip', title: __('Loginip'), operate: 'LIKE'},
  146. // {field: 'loginfailure', title: __('Loginfailure')},
  147. // {field: 'joinip', title: __('Joinip'), operate: 'LIKE'},
  148. {field: 'jointime', title: __('Jointime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  149. // {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  150. // {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  151. // {field: 'token', title: __('Token'), operate: 'LIKE'},
  152. {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
  153. // {field: 'verification', title: __('Verification'), operate: 'LIKE'},
  154. // {field: 'mini_openid', title: __('Mini_openid'), operate: 'LIKE'},
  155. // {field: 'mini_sessionkey', title: __('Mini_sessionkey'), operate: 'LIKE'},
  156. // {field: 'unionid', title: __('Unionid'), operate: 'LIKE'},
  157. {field: 'introcode', title: __('Introcode'), operate: 'LIKE'},
  158. {field: 'last_paytime', title: __('Last_paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  159. {field: 'tendaysago', title: '最后支付底线'},
  160. // {field: 'intro_num', title: __('Intro_num')},
  161. // {field: 'intro_num_all', title: __('Intro_num_all')},
  162. {field: 'intro_uid', title: __('Intro_uid')},
  163. {field: 'score', title: '用户积分'},
  164. {field: 'sum_order_price', title: '总支付额'},
  165. {field: 'special', title: '是否超2倍'},
  166. // {field: 'intro_ids', title: __('Intro_ids')},
  167. // {field: 'intro_level', title: __('Intro_level')},
  168. {field: 'operate', title: __('Operate'), table: table,
  169. buttons:[
  170. {
  171. name:'registerurl',
  172. text:'注册链接',
  173. title:'注册链接',
  174. icon:'fa fa-exclamation-circle',
  175. classname:'btn btn-xs btn-danger btn-dialog',
  176. url:'user/user/registerurl/id/{ids}?dialog=1',
  177. refresh:true
  178. }
  179. ],
  180. table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  181. ]
  182. ]
  183. });
  184. // 为表格绑定事件
  185. Table.api.bindevent(table);
  186. },
  187. add: function () {
  188. Controller.api.bindevent();
  189. },
  190. scoreadd: function () {
  191. Controller.api.bindevent();
  192. },
  193. shouyiadd: function () {
  194. Controller.api.bindevent();
  195. },
  196. edit: function () {
  197. Controller.api.bindevent();
  198. },
  199. zhuanyiintro: function () {
  200. Controller.api.bindevent();
  201. },
  202. api: {
  203. bindevent: function () {
  204. Form.api.bindevent($("form[role=form]"));
  205. }
  206. }
  207. };
  208. return Controller;
  209. });