Finance.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xurongyao <763569752@qq.com>
  5. * Date: 2018/6/14 下午5:25
  6. */
  7. namespace app\admin\controller\finance;
  8. use app\admin\controller\AuthController;
  9. use app\admin\model\user\UserBill;
  10. use service\JsonService as Json;
  11. use app\admin\model\finance\FinanceModel;
  12. use service\UtilService as Util;
  13. use service\FormBuilder as Form;
  14. //use FormBuilder\Form;
  15. use service\HookService;
  16. use think\Url;
  17. use app\admin\model\user\User;
  18. use app\admin\model\user\UserExtract;
  19. /**
  20. * 微信充值记录
  21. * Class UserRecharge
  22. * @package app\admin\controller\user
  23. */
  24. class Finance extends AuthController
  25. {
  26. /**
  27. * 显示操作记录
  28. */
  29. public function index(){
  30. //创建form
  31. $form = Form::create('/save.php',[
  32. Form::input('goods_name','商品名称')
  33. ,Form::input('goods_name1','password')->type('password')
  34. ,Form::input('goods_name2','textarea')->type('textarea')
  35. ,Form::input('goods_name3','email')->type('email')
  36. ,Form::input('goods_name4','date')->type('date')
  37. ,Form::cityArea('address','cityArea',[
  38. '陕西省','西安市'
  39. ])
  40. ,Form::dateRange('limit_time','dateRange',
  41. strtotime('- 10 day'),
  42. time()
  43. )
  44. ,Form::dateTime('add_time','dateTime')
  45. ,Form::color('color','color','#ff0000')
  46. ,Form::checkbox('checkbox','checkbox',[1])->options([['value'=>1,'label'=>'白色'],['value'=>2,'label'=>'红色'],['value'=>31,'label'=>'黑色']])
  47. ,Form::date('riqi','date','2018-03-1')
  48. ,Form::dateTimeRange('dateTimeRange','区间时间段')
  49. ,Form::year('year','year')
  50. ,Form::month('month','month')
  51. ,Form::frame('frame','frame','http://baidu.com')
  52. ,Form::frameInputs('month','frameInputs','http://baidu.com')
  53. ,Form::frameFiles('month1','frameFiles','http://baidu.com')
  54. ,Form::frameImages('month2','frameImages','http://baidu.com')
  55. ,Form::frameInputOne('month3','frameInputOne','http://baidu.com')
  56. ,Form::frameFileOne('month4','frameFileOne','http://baidu.com')
  57. ,Form::frameImageOne('month5','frameImageOne','http://baidu.com')
  58. ,Form::hidden('month6','hidden')
  59. ,Form::number('month7','number')
  60. // ,Form::input input输入框,其他type: text类型Form::text,password类型Form::password,textarea类型Form::textarea,url类型Form::url,email类型Form::email,date类型Form::idate
  61. ,Form::radio('month8','radio')->options([['value'=>1,'label'=>'白色'],['value'=>2,'label'=>'红色'],['value'=>31,'label'=>'黑色']])
  62. ,Form::rate('month9','rate')
  63. ,Form::select('month10','select')->options([['value'=>1,'label'=>'白色'],['value'=>2,'label'=>'红色'],['value'=>31,'label'=>'黑色']])
  64. ,Form::selectMultiple('month11','selectMultiple')
  65. ,Form::selectOne('month12','selectOne')
  66. ,Form::slider('month13','slider',2)
  67. ,Form::sliderRange('month23','sliderRange',2,13)
  68. ,Form::switches('month14','区间时间段')
  69. ,Form::timePicker('month15','区间时间段')
  70. ,Form::time('month16','区间时间段')
  71. ,Form::timeRange('month17','区间时间段')
  72. // ,Form::upload('month','区间时间段')
  73. // ,Form::uploadImages('month','区间时间段')
  74. // ,Form::uploadFiles('month','区间时间段')
  75. // ,Form::uploadImageOne('month','区间时间段')
  76. // ,Form::uploadFileOne('month','区间时间段')
  77. ]);
  78. $html = $form->setMethod('get')->setTitle('编辑商品')->view();
  79. echo $html;
  80. }
  81. /**
  82. * 显示资金记录
  83. */
  84. public function bill(){
  85. $list=UserBill::where('type','not in',['gain','system_sub','deduction','sign'])
  86. ->where('category','not in','integral')
  87. ->field(['title','type'])
  88. ->group('type')
  89. ->distinct(true)
  90. ->select()
  91. ->toArray();
  92. $this->assign('selectList',$list);
  93. return $this->fetch();
  94. }
  95. /**
  96. * 显示资金记录ajax列表
  97. */
  98. public function billlist(){
  99. $where = Util::getMore([
  100. ['start_time',''],
  101. ['end_time',''],
  102. ['nickname',''],
  103. ['limit',20],
  104. ['page',1],
  105. ['type',''],
  106. ]);
  107. return Json::successlayui(FinanceModel::getBillList($where));
  108. }
  109. /**
  110. *保存资金监控的excel表格
  111. */
  112. public function save_bell_export(){
  113. $where = Util::getMore([
  114. ['start_time',''],
  115. ['end_time',''],
  116. ['nickname',''],
  117. ['type',''],
  118. ]);
  119. FinanceModel::SaveExport($where);
  120. }
  121. // /**
  122. // * 显示佣金记录
  123. // */
  124. // public function commission_list(){
  125. //
  126. // //创建form
  127. // $form = Form::create('/save.php',[
  128. // Form::input('goods_name','商品名称')
  129. // ,Form::input('goods_name1','password')->type('password')
  130. // ,Form::input('goods_name3','email')->type('email')
  131. // ,Form::input('goods_name4','date')->type('date')
  132. // ,Form::cityArea('address','cityArea',[
  133. // '陕西省','西安市'
  134. // ])
  135. // ,Form::dateRange('limit_time','dateRange',
  136. // strtotime('- 10 day'),
  137. // time()
  138. // )
  139. // ,Form::dateTime('add_time','dateTime')
  140. // ,Form::color('color','color','#ff0000')
  141. // ,Form::checkbox('checkbox','checkbox',[1])->options([['value'=>1,'label'=>'白色'],['value'=>2,'label'=>'红色'],['value'=>31,'label'=>'黑色']])
  142. // ,Form::date('riqi','date','2018-03-1')
  143. // ,Form::dateTimeRange('dateTimeRange','区间时间段')
  144. // ,Form::year('year','year')
  145. //
  146. // ,Form::hidden('month6','hidden')
  147. // ,Form::number('month7','number')
  148. //
  149. //
  150. // ]);
  151. // $rule = $form->setMethod('post')->setTitle('编辑商品')->getRules();
  152. // $action = Url::build('save');
  153. // $this->assign(compact('form','rule','action'));
  154. // return $this->fetch();
  155. // }
  156. /**
  157. * 显示佣金记录
  158. */
  159. public function commission_list(){
  160. $this->assign('is_layui',true);
  161. return $this->fetch();
  162. }
  163. /**
  164. * 佣金记录异步获取
  165. */
  166. public function get_commission_list(){
  167. $get=Util::getMore([
  168. ['page',1],
  169. ['limit',20],
  170. ['nickname',''],
  171. ['price_max',''],
  172. ['price_min',''],
  173. ['order','']
  174. ]);
  175. return Json::successlayui(User::getCommissionList($get));
  176. }
  177. /**
  178. * 保存excel表格
  179. */
  180. public function save_export(){
  181. $get=Util::getMore([
  182. ['page',1],
  183. ['limit',20],
  184. ['nickname',''],
  185. ['price_max',''],
  186. ['price_min',''],
  187. ['order','']
  188. ]);
  189. User::setUserWhere($get,true);
  190. }
  191. /**
  192. * 显示操作记录
  193. */
  194. public function index3(){
  195. }
  196. /**
  197. * 佣金详情
  198. */
  199. public function content_info($uid=''){
  200. if($uid=='') return $this->failed('缺少参数');
  201. $this->assign('userinfo',User::getUserinfo($uid));
  202. $this->assign('uid',$uid);
  203. return $this->fetch();
  204. }
  205. /**
  206. * 佣金提现记录个人列表
  207. */
  208. public function get_extract_list($uid=''){
  209. if($uid=='') return Json::fail('缺少参数');
  210. $where=Util::getMore([
  211. ['page',1],
  212. ['limit',20],
  213. ['start_time',''],
  214. ['end_time',''],
  215. ['nickname','']
  216. ]);
  217. return Json::successlayui(UserBill::getExtrctOneList($where,$uid));
  218. }
  219. }