| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- <?php
- // +----------------------------------------------------------------------
- // | likeshop开源商城系统
- // +----------------------------------------------------------------------
- // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
- // | gitee下载:https://gitee.com/likeshop_gitee
- // | github下载:https://github.com/likeshop-github
- // | 访问官网:https://www.likeshop.cn
- // | 访问社区:https://home.likeshop.cn
- // | 访问手册:http://doc.likeshop.cn
- // | 微信公众号:likeshop技术社区
- // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
- // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
- // | 禁止对系统程序代码以任何目的,任何形式的再发布
- // | likeshop团队版权所有并拥有最终解释权
- // +----------------------------------------------------------------------
- // | author: likeshop.cn.team
- // +----------------------------------------------------------------------
- namespace app\admin\controller\finance;
- use app\common\basics\AdminBase;
- use app\common\server\ConfigServer;
- use app\common\server\JsonServer;
- use app\admin\logic\finance\WithdrawLogic;
- use app\admin\logic\finance\DividendCashLogic;
- /**
- * 财务-分红池相关
- * Class User
- * @package app\admin\controller\finance
- */
- class Dividend extends AdminBase
- {
- /**
- * @notes 分红池资金明细列表
- * @return \think\response\Json|\think\response\View
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- * @author suny
- * @date 2021/7/13 7:02 下午
- */
- public function dividend_cash()
- {
- if ($this->request->isAjax()) {
- $get = $this->request->get();
- $data = DividendCashLogic::cash($get);
- return JsonServer::success('', $data, 1);
- }
- $today = [
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", time()))),
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", time())) + 86399)
- ];
- $yesterday = [
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day")))),
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day"))) + 86399)
- ];
- $days_ago7 = [
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-7 day")))),
- date('Y-m-d 23:59:59', time())
- ];
- $days_ago30 = [
- date('Y-m-d 00:00:00', strtotime("-30 day")),
- date('Y-m-d 23:59:59', time())
- ];
- $dividend_cash = ConfigServer::get('platform_setting', 'dividend_cash', 0);
- return view('', [
- 'today' => $today,
- 'yesterday' => $yesterday,
- 'days_ago7' => $days_ago7,
- 'days_ago30' => $days_ago30,
- 'dividend_cash'=>$dividend_cash,
- ]);
- }
- /**
- * @notes 分红排队列表
- * @return \think\response\Json|\think\response\View
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- * @author suny
- * @date 2021/7/13 7:02 下午
- */
- public function dividend_order()
- {
- if ($this->request->isAjax()) {
- $get = $this->request->get();
- $data = DividendCashLogic::order($get);
- return JsonServer::success('', $data, 1);
- }
- $today = [
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", time()))),
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", time())) + 86399)
- ];
- $yesterday = [
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day")))),
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day"))) + 86399)
- ];
- $days_ago7 = [
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-7 day")))),
- date('Y-m-d 23:59:59', time())
- ];
- $days_ago30 = [
- date('Y-m-d 00:00:00', strtotime("-30 day")),
- date('Y-m-d 23:59:59', time())
- ];
- return view('', [
- 'today' => $today,
- 'yesterday' => $yesterday,
- 'days_ago7' => $days_ago7,
- 'days_ago30' => $days_ago30,
- ]);
- }
- /**
- * @notes 排队订单详情
- * @return \think\response\View
- * @author suny
- * @date 2021/7/13 7:02 下午
- */
- public function detail()
- {
- $id = $this->request->get('id', '', 'intval');
- if ($this->request->isAjax()) {
- $get = $this->request->get();
- $data = DividendCashLogic::detail($get);
- return JsonServer::success('', $data, 1);
- }
- $today = [
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", time()))),
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", time())) + 86399)
- ];
- $yesterday = [
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day")))),
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day"))) + 86399)
- ];
- $days_ago7 = [
- date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-7 day")))),
- date('Y-m-d 23:59:59', time())
- ];
- $days_ago30 = [
- date('Y-m-d 00:00:00', strtotime("-30 day")),
- date('Y-m-d 23:59:59', time())
- ];
- return view('detail', [
- 'id' => $id,
- 'today' => $today,
- 'yesterday' => $yesterday,
- 'days_ago7' => $days_ago7,
- 'days_ago30' => $days_ago30,
- ]);
- }
- /**
- * @notes 导出账户明细Excel
- * @return \think\response\Json
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- * @author 段誉
- * @date 2022/4/24 10:20
- */
- public function cashExport()
- {
- $params = $this->request->get();
- $result = DividendCashLogic::cash($params, true);
- if(false === $result) {
- return JsonServer::error(DividendCashLogic::getError() ?: '导出失败');
- }
- return JsonServer::success('', $result);
- }
- /**
- * @notes 导出佣金提现Excel
- * @return \think\response\Json
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- * @author 段誉
- * @date 2022/4/24 10:20
- */
- public function orderExport()
- {
- $params = $this->request->get();
- $result = DividendCashLogic::order($params, true);
- if(false === $result) {
- return JsonServer::error(DividendCashLogic::getError() ?: '导出失败');
- }
- return JsonServer::success('', $result);
- }
- /**
- * @notes 导出佣金提现Excel
- * @return \think\response\Json
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- * @author 段誉
- * @date 2022/4/24 10:20
- */
- public function detailExport()
- {
- $params = $this->request->get();
- $result = DividendCashLogic::detail($params, true);
- if(false === $result) {
- return JsonServer::error(DividendCashLogic::getError() ?: '导出失败');
- }
- return JsonServer::success('', $result);
- }
- }
|