123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?php
- /**
- * Niushop商城系统 - 团队十年电商经验汇集巨献!
- * =========================================================
- * Copy right 2019-2029 山西牛酷信息科技有限公司, 保留所有权利。
- * ----------------------------------------------
- * 官方网址: https://www.niushop.com.cn
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
- * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
- * =========================================================
- */
- namespace app\admin\controller;
- use app\model\shop\ShopDeposit;
- use app\model\web\Account as AccountModel;
- use app\model\shop\Shop;
- use app\model\web\WebSite;
- use addon\fenxiao\model\FenxiaoData;
- /**
- * 账户数据控制器
- */
- class Account extends BaseAdmin
- {
- /**
- * 数据概况
- * @return mixed
- */
- public function index()
- {
- $account_model = new AccountModel();
- $website_model = new WebSite();
- //订单金额
- $order_sum = $account_model->getOrderSum();
- //店铺结算
- $shop_settlement_sum = $account_model->getShopSettlementSum();
- //店铺费用、店铺保证金、店铺提现、店铺余额
- $shop_sum = $account_model->getShopDataSum();
- //会员余额
- $member_balance_sum = $account_model->getMemberBalanceSum();
- $is_memberwithdraw = addon_is_exit('memberwithdraw');
- $this->assign('is_memberwithdraw',$is_memberwithdraw);
- if($is_memberwithdraw == 1){
- $this->assign('member_balance_sum',$member_balance_sum['data']);
- }else{
- $member_balance = number_format($member_balance_sum['data']['balance']+$member_balance_sum['data']['balance_money'],2, '.' , '');
- $this->assign('member_balance',$member_balance);
- }
- $settlement_sum = $shop_settlement_sum['data']['shop_money']-$shop_settlement_sum['data']['refund_shop_money']-$shop_settlement_sum['data']['commission'];
- $account = [
- 'order_sum' => $order_sum['data'],
- 'shop_settlement_sum' => number_format($settlement_sum,2, '.' , ''),
- 'shop_fee' => $shop_sum['data']['shop_open_fee'],
- 'shop_baozhrmb' => $shop_sum['data']['account'],
- 'account_withdraw' => $shop_sum['data']['account_withdraw'],
- 'account_withdraw_apply' => $shop_sum['data']['account_withdraw_apply'],
- 'account' => $shop_sum['data']['account']
- ];
- $this->assign('account', $account);
- return $this->fetch("account/index");
- }
- /**
- * 佣金列表
- */
- public function lists()
- {
- if (request()->isAjax()) {
- $page_index = input('page', 1);
- $page_size = input('page_size', PAGE_LIST_ROWS);
- $site_name = input("site_name", '');
- $start_time = input("start_time", '');
- $end_time = input("end_time", '');
- $condition = [
- [ "na.account_type", "=", 'account' ]
- ];
- if (!empty($site_name)) {
- $condition[] = [ 'no.site_name', 'like', '%' . $site_name . '%' ];
- }
- if (!empty($start_time) && empty($end_time)) {
- $condition[] = [ 'na.create_time', '>=', date_to_time($start_time) ];
- } elseif (empty($start_time) && !empty($end_time)) {
- $condition[] = [ "na.create_time", "<=", date_to_time($end_time) ];
- } elseif (!empty($start_time) && !empty($end_time)) {
- $condition[] = [ 'na.create_time', 'between', [ date_to_time($start_time), date_to_time($end_time) ] ];
- }
- $account_model = new AccountModel();
- $list = $account_model->getOrderAccountPageList($condition, $page_index, $page_size);
- return $list;
- }else{
- return $this->fetch("account/lists");
- }
- }
- /**
- * 订单列表
- */
- public function order()
- {
- return $this->fetch("account/order");
- }
- /**
- * 店铺余额
- */
- public function shopBalance()
- {
- if (request()->isAjax()) {
- $page_index = input('page', 1);
- $page_size = input('page_size', PAGE_LIST_ROWS);
- $site_name = input("site_name", '');
- $condition = [];
- $condition[] = [ 'site_name', 'like', '%' . $site_name . '%' ];
- $shop_model = new Shop();
- $list = $shop_model->getShopPageList($condition, $page_index, $page_size, '', 'site_id, site_name, category_name, group_name, account, account_withdraw, shop_open_fee, shop_baozhrmb, logo, is_own, account_withdraw_apply, shop_status');
- return $list;
- }else{
- return $this->fetch("account/shop_balance");
- }
- }
- /**
- * 店铺余额
- */
- public function shopDeposit()
- {
- if (request()->isAjax()) {
- $page_index = input('page', 1);
- $page_size = input('page_size', PAGE_LIST_ROWS);
- $site_name = input("site_name", '');
- $condition = [];
- $condition[] = [ 'site_name', 'like', '%' . $site_name . '%' ];
- $shop_model = new ShopDeposit();
- $list = $shop_model->getShopDepositPageList($condition, $page_index, $page_size, 'id desc');
- return $list;
- }else{
- return $this->fetch("account/shop_deposit");
- }
- }
- }
|