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"); } } }