123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\admin\controller\finance;
-
- use app\common\basics\AdminBase;
- use app\common\model\AccountLog;
- use app\common\server\JsonServer;
- use app\admin\logic\finance\WithdrawLogic;
- use app\common\model\order\Order as OrderModel;
- use app\common\model\Client_;
- use app\common\enum\PayEnum;
-
-
- class User extends AdminBase
- {
-
-
- public function withdrawal()
- {
-
- if ($this->request->isAjax()) {
- $get = $this->request->get();
- $data = WithdrawLogic::lists($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())
- ];
- $summary = WithdrawLogic::summary();
- return view('', [
- 'today' => $today,
- 'yesterday' => $yesterday,
- 'days_ago7' => $days_ago7,
- 'days_ago30' => $days_ago30,
- 'summary' => $summary
- ]);
- }
-
-
-
- public function commission()
- {
-
- if ($this->request->isAjax()) {
- $get = $this->request->get();
- $data = WithdrawLogic::commission($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,
- 'source_type' => AccountLog::getEarningsChange()
- ]);
- }
-
-
-
- public function recharge()
- {
-
- if ($this->request->isAjax()) {
- $get = $this->request->get();
- $data = WithdrawLogic::recharge($get);
- return JsonServer::success('', $data, 1);
- }
-
- $order_status = OrderModel::getOrderStatus(true);
-
- $order_type = OrderModel::getOrderType(true);
-
- $order_source = Client_::getClient(true);
- unset($order_source[2]);
-
- $pay_way = PayEnum::getPayWay(true);
- unset($pay_way[3], $pay_way[4]);
-
- $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('', [
- 'order_status' => $order_status,
- 'order_type' => $order_type,
- 'order_source' => $order_source,
- 'pay_way' => $pay_way,
- 'today' => $today,
- 'yesterday' => $yesterday,
- 'days_ago7' => $days_ago7,
- 'days_ago30' => $days_ago30,
- ]);
- }
-
-
-
-
- public function account()
- {
-
- if ($this->request->isAjax()) {
- $get = $this->request->get();
- $data = WithdrawLogic::account($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,
- ]);
- }
-
-
-
- public function withdraw_detail()
- {
-
- $id = $this->request->get('id', '', 'intval');
- $detail = WithdrawLogic::detail($id);
- return view('detail', [
- 'detail' => $detail
- ]);
- }
-
-
-
- public function withdraw_review()
- {
-
- $id = $this->request->get('id', '', 'intval');
- return view('review', [
- 'id' => $id
- ]);
- }
-
-
-
- public function confirm()
- {
-
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- $result = WithdrawLogic::confirm($post);
- if ($result['code']) {
- return JsonServer::success($result['msg']);
- } else {
- return JsonServer::error($result['msg']);
- }
- }
- }
-
-
-
- public function refuse()
- {
-
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- WithdrawLogic::refuse($post);
- return JsonServer::success('已拒绝提现');
- }
- }
-
-
-
- public function transfer()
- {
-
- $id = $this->request->get('id', '', 'intval');
- return view('', [
- 'id' => $id
- ]);
- }
-
-
-
- public function transferFail()
- {
-
- $post = $this->request->post();
- $result = WithdrawLogic::transferFail($post);
- if ($result['code']) {
- return JsonServer::success($result['msg']);
- } else {
- return JsonServer::error($result['msg']);
- }
- }
-
-
-
- public function transferSuccess()
- {
-
- $post = $this->request->post();
- $result = WithdrawLogic::transferSuccess($post);
- if ($result['code']) {
- return JsonServer::success($result['msg']);
- } else {
- return JsonServer::error($result['msg']);
- }
- }
-
-
-
- public function search()
- {
-
- $id = $this->request->post('id', '', 'intval');
- $result = WithdrawLogic::search($id);
- if ($result['code']) {
- return JsonServer::success($result['msg']);
- } else {
- return JsonServer::error($result['msg']);
- }
- }
-
-
-
- public function withdrawFailed()
- {
-
- $id = $this->request->post('id', '', 'intval');
- WithdrawLogic::withdrawFailed($id);
- return JsonServer::success('提现失败已回退佣金');
- }
-
-
-
-
- public function rechargeExport()
- {
- $params = $this->request->get();
- $result = WithdrawLogic::recharge($params, true);
- if(false === $result) {
- return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
- }
- return JsonServer::success('', $result);
- }
-
-
-
-
- public function accountExport()
- {
- $params = $this->request->get();
- $result = WithdrawLogic::account($params, true);
- if(false === $result) {
- return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
- }
- return JsonServer::success('', $result);
- }
-
-
-
-
- public function commissionExport()
- {
- $params = $this->request->get();
- $result = WithdrawLogic::commission($params, true);
- if(false === $result) {
- return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
- }
- return JsonServer::success('', $result);
- }
-
-
-
-
-
- public function withdrawalExport()
- {
- $params = $this->request->get();
- $result = WithdrawLogic::lists($params, true);
- if(false === $result) {
- return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
- }
- return JsonServer::success('', $result);
- }
- }
|