123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <?php
- namespace app\admin\controller\finance;
- use app\admin\controller\AuthController;
- use app\admin\model\user\UserBill;
- use service\JsonService as Json;
- use app\admin\model\finance\FinanceModel;
- use service\SystemConfigService;
- use service\FormBuilder as Form;
- use service\HookService;
- use think\Url;
- use app\admin\model\user\User;
- use app\admin\model\user\UserExtract;
- class Finance extends AuthController
- {
-
- public function bill()
- {
- $category = $this->request->param('category','now_money');
- $bill_where_op = FinanceModel::bill_where_op($category);
- $list = UserBill::where('type', $bill_where_op['type']['op'], $bill_where_op['type']['condition'])
- ->where('category', $bill_where_op['category']['op'], $bill_where_op['category']['condition'])
- ->field(['title', 'type'])
- ->group('type')
- ->distinct(true)
- ->select()
- ->toArray();
- $this->assign('selectList', $list);
- $this->assign('category', $category);
- $this->assign('gold_name', $category == "now_money" ? "金额" : SystemConfigService::get("gold_name"));
- return $this->fetch();
- }
-
- public function billlist()
- {
- $where = parent::getMore([
- ['start_time', ''],
- ['end_time', ''],
- ['nickname', ''],
- ['limit', 20],
- ['page', 1],
- ['type', ''],
- ['category', 'now_money'],
- ]);
- return Json::successlayui(FinanceModel::getBillList($where));
- }
-
- public function save_bell_export()
- {
- $where = parent::getMore([
- ['start_time', ''],
- ['end_time', ''],
- ['nickname', ''],
- ['type', ''],
- ['category', 'now_money'],
- ]);
- FinanceModel::SaveExport($where);
- }
-
- public function commission_list()
- {
- $this->assign('is_layui', true);
- return $this->fetch();
- }
-
- public function get_commission_list()
- {
- $get = parent::getMore([
- ['page', 1],
- ['limit', 20],
- ['nickname', ''],
- ['price_max', ''],
- ['price_min', ''],
- ['order', '']
- ]);
- return Json::successlayui(User::getCommissionList($get));
- }
-
- public function content_info($uid = '')
- {
- if ($uid == '') return $this->failed('缺少参数');
- $this->assign('userinfo', User::getUserinfo($uid));
- $this->assign('uid', $uid);
- return $this->fetch();
- }
-
- public function get_extract_list($uid = '')
- {
- if ($uid == '') return Json::fail('缺少参数');
- $where = parent::getMore([
- ['page', 1],
- ['limit', 20],
- ['start_time', ''],
- ['end_time', ''],
- ['nickname', '']
- ]);
- return Json::successlayui(UserBill::getExtrctOneList($where, $uid));
- }
- }
|