| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539 |
- <?php
- namespace addons\Store\backend\controllers;
- use addons\Store\common\logic\order\OrderCommissionLogic;
- use addons\Store\common\models\Store;
- use addons\Store\common\models\StoreCommission;
- use addons\Store\common\models\StoreOrder;
- use common\enums\AddonsEnum;
- use common\enums\DownloadEnum;
- use common\enums\StatusEnum;
- use common\helpers\ArrayHelper;
- use common\helpers\csv\CsvExportHelper;
- use common\models\common\CapitalLog;
- use common\models\common\CommissionLog;
- use common\models\mall\MallAddons;
- use common\models\user\User;
- class StoreAssetsController extends BaseController
- {
- public function actionIndex()
- {
- if (!\Yii::$app->request->isAjax) {
- return $this->render('/store-assets/index');
- }
- if (\Yii::$app->request->isGet) {
- $tabname = \Yii::$app->request->get('tabname');
- if (empty($tabname) || !in_array($tabname, ['order-detail', 'cashier','platform-store-clerk','secondary_card'])) {
- return $this->error('参数错误: tabname');
- }
- if ('order-detail' == $tabname || 'platform-store-clerk' == $tabname) {
- $type = $tabname == 'order-detail' ? 1 : 3;
- return $this->orderDetailList($type);
- } else if('cashier' == $tabname) {
- return $this->cashierList();
- } else if('secondary_card' == $tabname) {
- return $this->secondaryCardList();
- }
- }
- if (\Yii::$app->request->post('flag') == 'EXPORT') {
- $post = \Yii::$app->request->post();
- $post['mall_id'] = $this->mall_id;
- $filename = '平台-门店收银台资产明细列表-' . date('YmdHis') . '_' . rand(10000, 99999);
- $method = 'exportHandle';
- $type = DownloadEnum::TYPE_STORE_CASHIER;
- if ($post['activityTab'] == 'order-detail') {
- $filename = '平台-门店订单明细列表-' . date('YmdHis') . '_' . rand(10000, 99999);
- $method = 'orderDetailExportHandle';
- $type = DownloadEnum::TYPE_ASSETS;
- }
- $res = CsvExportHelper::exportDownLoadCenter($this->mall_id, $filename, $type, StoreCommission::class, $method, $post);
- if ($res === false) return $this->error('加入导出任务失败' . CsvExportHelper::getStaticError());
- return $this->success('添加导出任务成功,任务完成后请在下载中心进行下载!');
- }
- }
- /**
- * @name:
- * @msg: 门店订单明细
- * @param {*}
- * @return {*}
- */
- private function orderDetailList($type = 1)
- {
- $page = \Yii::$app->request->get('page', 1);
- $limit = \Yii::$app->request->get('limit', $this->pageSize);
- $store_name = \Yii::$app->request->get('store_name');
- $user_id = \Yii::$app->request->get('user_id');
- $nickname = \Yii::$app->request->get('nickname');
- $mobile = \Yii::$app->request->get('mobile');
- $order_no = \Yii::$app->request->get('order_no');
- $order_status = \Yii::$app->request->get('order_status');
- if (!in_array($order_status, [0, 1, 2, 3])) {
- return $this->error('参数错误:order_status');
- }
- $wheres[] = ['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'type' => $type];
- $stores = [];
- if (!empty($store_name)) {
- $stores = Store::find()
- ->select('id,store_name,logo_img')
- ->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED])
- ->andWhere(['like', 'store_name', $store_name])
- ->asArray()
- ->indexBy('id')
- ->all();
- $store_ids = array_column($stores, 'id');
- $wheres[] = ['store_id' => $store_ids];
- }
- if (!empty($user_id)) {
- $wheres[] = ['user_id' => $user_id];
- }
- $user_wheres = [];
- $users = [];
- if (!empty($nickname)) {
- $user_wheres[] = ['like', 'nickname', $nickname];
- }
- if (!empty($mobile)) {
- $user_wheres[] = ['like', 'mobile', $mobile];
- }
- if (!empty($user_wheres)) {
- $user_wheres[] = ['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED];
- $query = User::find()->select('id,nickname,mobile,avatar_url');
- foreach ($user_wheres as $where) {
- $query->andWhere($where);
- }
- $users = $query->asArray()->indexBy('id')->all();
- $user_ids = array_column($users, 'id');
- $wheres[] = ['user_id' => $user_ids];
- }
- if (!empty($order_no)) {
- $wheres[] = ['like', 'order_no', $order_no];
- }
- if (!empty($order_status)) {
- if (1 == $order_status) {
- $wheres[] = ['is_settlement' => 0];
- } elseif (2 == $order_status) {
- $wheres[] = ['is_settlement' => 1];
- } else {
- $wheres[] = ['!=', 'status', StatusEnum::ENABLED];
- }
- }
- $params = [
- 'select' => 'id,mall_id,store_id,user_id,order_no,order_money,pay_money,discount_money,addons_bonus,service_charge,amount_received,is_settlement,created_at,status,store_send_commission,store_agent_send_commission',
- 'where' => $wheres,
- 'order' => 'created_at desc',
- 'page' => $page,
- 'limit' => $limit
- ];
- $log_list = StoreCommission::listPage($params);
- $log_list['orderDetailFieldsList'] = StoreCommission::orderDetailFieldsList();
- if (empty($log_list['list'])) {
- if (false === $log_list['list']) {
- return $this->error(StoreCommission::getStaticError());
- }
- return $this->success('success', $log_list);
- }
- if (empty($stores)) {
- $store_ids = array_column($log_list['list'], 'store_id');
- $stores = Store::find()
- ->select('id,store_name,logo_img')
- ->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED])
- ->andWhere(['like', 'store_name', $store_name])
- ->asArray()
- ->indexBy('id')
- ->all();
- }
- if (empty($users)) {
- $user_ids = array_column($log_list['list'], 'user_id');
- $users = User::find()
- ->select('id,nickname,mobile,avatar_url')
- ->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'id' => $user_ids])
- ->asArray()
- ->indexBy('id')
- ->all();
- }
- foreach ($log_list['list'] as &$list) {
- $store = $stores[$list['store_id']] ?? [];
- $user = $users[$list['user_id']] ?? [];
- $list['nickname'] = $user['nickname'] ?? '';
- $list['mobile'] = $user['mobile'] ?? '';
- $list['avatar_url'] = !empty($user['avatar_url']) ? $user['avatar_url'] : \Yii::$app->request->hostInfo . '/resources/img/common/default-avatar.png';
- $list['store_name'] = $store['store_name'] ?? '';
- $list['store_logo'] = $store['logo_img'] ?? \Yii::$app->request->hostInfo . '/resources/img/common/o2o-store-default-logo.png';
- if ($list['status'] != StatusEnum::ENABLED) {
- $list['settle_status'] = 3;
- } else {
- if ($list['is_settlement'] == 0) {
- $list['settle_status'] = 1;
- } else {
- $list['settle_status'] = 2;
- }
- }
- }
- $total_order_amounts = StoreCommission::find()->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'type' => $type])->sum('order_money');
- $settle_order_amounts = StoreCommission::find()->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED,'is_settlement'=>1, 'type' => $type])->sum('amount_received');
- $not_settle_order_amounts = StoreCommission::find()->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED,'is_settlement'=>0, 'type' => $type])->sum('amount_received');
- if(empty($total_order_amounts)) $total_order_amounts = 0;
- if(empty($settle_order_amounts)) $settle_order_amounts = 0;
- if(empty($not_settle_order_amounts)) $not_settle_order_amounts = 0;
- $log_list['total_order_amounts'] = round($total_order_amounts, 2);
- $log_list['settle_order_amounts'] = round($settle_order_amounts, 2);
- $log_list['not_settle_order_amounts'] = round($not_settle_order_amounts, 2);
- $log_list['install_platform_store_clerk'] = MallAddons::isInstall($this->mall_id, AddonsEnum::ADDONS_NAME_PLATFORM_STORE_CLERK) ? 1 : 0;
- $log_list['install_secondary_card'] = MallAddons::isInstall($this->mall_id, 'SecondaryCard') ? 1 : 0;
- return $this->success('success', $log_list);
- }
- // 收银台收入明细
- private function cashierList()
- {
- $page = \Yii::$app->request->get('page', 1);
- $limit = \Yii::$app->request->get('limit', $this->pageSize);
- $min_amount = \Yii::$app->request->get('min_amount');
- $max_amount = \Yii::$app->request->get('max_amount');
- $start_time = \Yii::$app->request->get('start_time');
- $end_time = \Yii::$app->request->get('end_time');
- $store_name = \Yii::$app->request->get('store_name');
- $user_id = \Yii::$app->request->get('user_id');
- $nickname = \Yii::$app->request->get('nickname');
- $wheres[] = ['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'type' => 2];
- if (!empty($min_amount)) {
- $wheres[] = ['>=', 'pay_money', $min_amount];
- }
- if (!empty($max_amount)) {
- $wheres[] = ['<=', 'pay_money', $max_amount];
- }
- if (!empty($start_time)) {
- $wheres[] = ['>=', 'created_at', $start_time];
- }
- if (!empty($end_time)) {
- $wheres[] = ['<=', 'created_at', $end_time];
- }
- if (!empty($store_name)) {
- $stores = Store::find()
- ->select('id,store_name,logo_img')
- ->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED])
- ->andWhere(['like', 'store_name', $store_name])
- ->asArray()
- ->indexBy('id')
- ->all();
- $store_ids = array_column($stores, 'id');
- $wheres[] = ['store_id' => $store_ids];
- }
- if (!empty($user_id)) {
- $wheres[] = ['user_id' => $user_id];
- }
- $user_wheres = [];
- $users = [];
- if (!empty($nickname)) {
- $user_wheres[] = ['like', 'nickname', $nickname];
- }
- if (!empty($mobile)) {
- $user_wheres[] = ['like', 'mobile', $mobile];
- }
- if (!empty($user_wheres)) {
- $user_wheres[] = ['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED];
- $query = User::find()->select('id,nickname,mobile,avatar_url');
- foreach ($user_wheres as $where) {
- $query->andWhere($where);
- }
- $users = $query->asArray()->indexBy('id')->all();
- $user_ids = array_column($users, 'id');
- $wheres[] = ['user_id' => $user_ids];
- }
- $params = [
- 'select' => 'id,mall_id,store_id,user_id,order_no,order_money,pay_money,discount_money,amount_received,is_settlement,service_charge,created_at',
- 'where' => $wheres,
- 'order' => 'created_at desc',
- 'page' => $page,
- 'limit' => $limit,
- ];
- // dd($params);
- $commission_logs = StoreCommission::listPage($params);
- if (false === $commission_logs['list']) {
- return $this->error(StoreCommission::getStaticError());
- }
- if (!empty($commission_logs['list'])) {
- if (empty($users)) {
- $user_ids = array_column($commission_logs['list'], 'user_id');
- $users = User::find()
- ->select('id,nickname,mobile,avatar_url')
- ->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'id' => $user_ids])
- ->asArray()
- ->indexBy('id')
- ->all();
- }
- if (empty($stores)) {
- $store_ids = array_column($commission_logs['list'], 'store_id');
- $stores = Store::find()
- ->select('id,store_name,logo_img')
- ->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'id' => $store_ids])
- ->andWhere(['like', 'store_name', $store_name])
- ->asArray()
- ->indexBy('id')
- ->all();
- }
- foreach ($commission_logs['list'] as &$log) {
- $user = $users[$log['user_id']] ?? [];
- $store = $stores[$log['store_id']] ?? [];
- $log['nickname'] = $user['nickname'] ?? '';
- $log['nickname'] = $user['nickname'] ?? '';
- $log['avatar_url'] = !empty($user['avatar_url']) ? $user['avatar_url'] : \Yii::$app->request->hostInfo . '/resources/img/common/default-avatar.png';
- $log['mobile'] = $user['mobile'] ?? '';
- $log['store_name'] = $store['store_name'] ?? '';
- $log['logo_img'] = $store['logo_img'] ?? '';
- }
- }
- $total_real_pay_amounts = StoreCommission::find()->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'type' => 2])->sum('order_money');
- $total_order_numbers = StoreCommission::find()->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'type' => 2])->count();
- $total_receive_amounts = StoreCommission::find()->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'type' => 2])->sum('amount_received');
- if(empty($total_real_pay_amounts)) $total_real_pay_amounts = 0;
- if(empty($total_receive_amounts)) $total_receive_amounts = 0;
- if(empty($total_order_numbers)) $total_order_numbers = 0;
- $commission_logs['total_real_pay_amounts'] = round($total_real_pay_amounts, 2);
- $commission_logs['total_receive_amounts'] = round($total_receive_amounts, 2);
- $commission_logs['total_order_numbers'] = $total_order_numbers;
- // 导出字段列表
- $export_fields = StoreCommission::fieldsList();
- $commission_logs['export_list'] = $export_fields;
- $commission_logs['install_platform_store_clerk'] = MallAddons::isInstall($this->mall_id, AddonsEnum::ADDONS_NAME_PLATFORM_STORE_CLERK) ? 1 : 0;
- return $this->success('success', $commission_logs);
- }
- private function secondaryCardList()
- {
- $page = \Yii::$app->request->get('page', 1);
- $limit = \Yii::$app->request->get('limit', $this->pageSize);
- $store_name = \Yii::$app->request->get('store_name');
- $user_id = \Yii::$app->request->get('user_id');
- $nickname = \Yii::$app->request->get('nickname');
- $mobile = \Yii::$app->request->get('mobile');
- $order_no = \Yii::$app->request->get('order_no');
- $order_status = \Yii::$app->request->get('order_status');
- if (!in_array($order_status, [0, 1, 2, 3])) {
- return $this->error('参数错误:order_status');
- }
- $type = 4;
- $wheres[] = ['mall_id' => $this->mall_id, ];
- $wheres[] = ['status' => StatusEnum::ENABLED];
- $wheres[] = [ 'type' => $type];
- $stores = [];
- if (!empty($store_name)) {
- $stores = Store::find()
- ->select('id,store_name,logo_img')
- ->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED])
- ->andWhere(['like', 'store_name', $store_name])
- ->asArray()
- ->indexBy('id')
- ->all();
- $store_ids = array_column($stores, 'id');
- $wheres[] = ['store_id' => $store_ids];
- }
- if (!empty($user_id)) {
- $wheres[] = ['user_id' => $user_id];
- }
- $user_wheres = [];
- $users = [];
- if (!empty($nickname)) {
- $user_wheres[] = ['like', 'nickname', $nickname];
- }
- if (!empty($mobile)) {
- $user_wheres[] = ['like', 'mobile', $mobile];
- }
- if (!empty($user_wheres)) {
- $user_wheres[] = ['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED];
- $query = User::find()->select('id,nickname,mobile,avatar_url');
- foreach ($user_wheres as $where) {
- $query->andWhere($where);
- }
- $users = $query->asArray()->indexBy('id')->all();
- $user_ids = array_column($users, 'id');
- $wheres[] = ['user_id' => $user_ids];
- }
- if (!empty($order_no)) {
- $wheres[] = ['like', 'order_no', $order_no];
- }
- if (!empty($order_status)) {
- if (1 == $order_status) {
- $wheres[] = ['is_settlement' => 0];
- } elseif (2 == $order_status) {
- $wheres[] = ['is_settlement' => 1];
- } else {
- $wheres[] = ['!=', 'status', StatusEnum::ENABLED];
- }
- }
- $params = [
- 'select' => 'id,mall_id,type,store_id,user_id,order_no,order_money,pay_money,discount_money,addons_bonus,service_charge,amount_received,is_settlement,created_at,status,store_send_commission,store_agent_send_commission',
- 'where' => $wheres,
- 'order' => 'created_at desc',
- 'page' => $page,
- 'limit' => $limit
- ];
- $log_list = StoreCommission::listPage($params);
- if (empty($log_list['list'])) {
- if (false === $log_list['list']) {
- return $this->error(StoreCommission::getStaticError());
- }
- return $this->success('success', $log_list);
- }
- if (empty($stores)) {
- $store_ids = array_column($log_list['list'], 'store_id');
- $stores = Store::find()
- ->select('id,store_name,logo_img')
- ->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED])
- ->andWhere(['like', 'store_name', $store_name])
- ->asArray()
- ->indexBy('id')
- ->all();
- }
- if (empty($users)) {
- $user_ids = array_column($log_list['list'], 'user_id');
- $users = User::find()
- ->select('id,nickname,mobile,avatar_url')
- ->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'id' => $user_ids])
- ->asArray()
- ->indexBy('id')
- ->all();
- }
- foreach ($log_list['list'] as &$list) {
- $store = $stores[$list['store_id']] ?? [];
- $user = $users[$list['user_id']] ?? [];
- $list['nickname'] = $user['nickname'] ?? '';
- $list['mobile'] = $user['mobile'] ?? '';
- $list['avatar_url'] = !empty($user['avatar_url']) ? $user['avatar_url'] : \Yii::$app->request->hostInfo . '/resources/img/common/default-avatar.png';
- $list['store_name'] = $store['store_name'] ?? '';
- $list['store_logo'] = $store['logo_img'] ?? \Yii::$app->request->hostInfo . '/resources/img/common/o2o-store-default-logo.png';
- }
- $total_order_amounts = StoreCommission::find()->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'type' => $type])->sum('order_money');
- $settle_order_amounts = StoreCommission::find()->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED,'is_settlement'=>1, 'type' => $type])->sum('amount_received');
- $not_settle_order_amounts = StoreCommission::find()->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED,'is_settlement'=>0, 'type' => $type])->sum('amount_received');
- if(empty($total_order_amounts)) $total_order_amounts = 0;
- if(empty($settle_order_amounts)) $settle_order_amounts = 0;
- if(empty($not_settle_order_amounts)) $not_settle_order_amounts = 0;
- $log_list['total_order_amounts'] = round($total_order_amounts, 2);
- $log_list['settle_order_amounts'] = round($settle_order_amounts, 2);
- $log_list['not_settle_order_amounts'] = round($not_settle_order_amounts, 2);
- $log_list['install_secondary_card'] = MallAddons::isInstall($this->mall_id, 'SecondaryCard') ? 1 : 0;
- return $this->success('success', $log_list);
- }
- /**
- * @name:
- * @msg: 获取插件分佣金额
- * @return {*}
- */
- public function actionAddonsCommission()
- {
- if (!\Yii::$app->request->isGet) {
- return $this->error('请求方式错误');
- }
- $id = \Yii::$app->request->get('id');
- $user_id = \Yii::$app->request->get('user_id');
- $order_no = \Yii::$app->request->get('order_no');
- $is_settlement = \Yii::$app->request->get('is_settlement');
- if (
- empty($id) ||
- empty($user_id) ||
- empty($order_no) ||
- !isset($is_settlement)
- ) {
- return $this->error('参数错误');
- }
- $addons_name_map = AddonsEnum::getAddonsNameMap();
- $result = [
- 'Agent' => ['name' => $addons_name_map['Agent'], 'value' => 0],
- 'Area' => ['name' => $addons_name_map['Area'], 'value' => 0],
- // 'Boss' => ['name' => $addons_name_map['Boss'], 'value' => 0],
- 'Distribution' => ['name' => $addons_name_map['Distribution'], 'value' => 0],
- 'Rebate' => ['name' => $addons_name_map['Rebate'], 'value' => 0],
- ];
- $log = StoreCommission::find()
- ->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'id' => $id, 'user_id' => $user_id, 'order_no' => $order_no, 'is_settlement' => $is_settlement])
- ->one();
- if (empty($log)) {
- return $this->success('success111', $result);
- }
- $order = StoreOrder::findOne(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED, 'user_id' => $user_id, 'order_no' => $order_no]);
- $order_detail = $order->detail;
- $order_detail_ids = array_column(ArrayHelper::toArray($order_detail), 'id');
- CapitalLog::$capitalType = 'commission_frozen';
- $commission_frozen_logs = CapitalLog::find()
- ->where(['mall_id' => $this->mall_id, 'source_table' => 'store_order_detail', 'source_table_id' => $order_detail_ids])
- ->asArray()
- ->all();
- if (!empty($commission_frozen_logs)) {
- foreach ($commission_frozen_logs as $flog) {
- if ($flog['status'] != 0) {
- continue;
- }
- if (!isset($result[$flog['from_type']]['value'])) {
- $result[$flog['from_type']]['value'] = 0;
- }
- $result[$flog['from_type']]['name'] = $addons_name_map[$flog['from_type']];
- $result[$flog['from_type']]['value'] += $flog['change_num'] ?? 0;
- }
- }
- CapitalLog::$capitalType = 'commission';
- $commission_logs = CapitalLog::find()
- ->where(['mall_id' => $this->mall_id, 'source_table' => 'store_order_detail', 'source_table_id' => $order_detail_ids])
- ->asArray()
- ->all();
- if (!empty($commission_logs)) {
- foreach ($commission_logs as $log) {
- if (!isset($result[$log['from_type']]['value'])) {
- $result[$log['from_type']]['value'] = 0;
- }
- $result[$log['from_type']]['name'] = $addons_name_map[$log['from_type']];
- $result[$log['from_type']]['value'] += $log['change_num'] ?? 0;
- }
- }
- foreach ($result as &$rst) {
- $rst['value'] = round($rst['value'], 2);
- }
- //加上股东
- $store_order_commission = OrderCommissionLogic::getOrderAddonsCommission($order->id);
- if($store_order_commission && isset($store_order_commission['Boss'])){
- $result['Boss'] = ['name' => $addons_name_map['Boss'], 'value' => 0];
- foreach($store_order_commission['Boss'] as $info){
- $result['Boss']['value'] = bcadd($result['Boss']['value'],$info['commission'],2);
- }
- }
- if($store_order_commission && isset($store_order_commission['Rebate'])){
- $result['Rebate'] = ['name' => $addons_name_map['Rebate'], 'value' => 0];
- foreach($store_order_commission['Rebate'] as $info){
- $result['Rebate']['value'] = bcadd($result['Rebate']['value'],$info['commission'],2);
- }
- }
- return $this->success('success222', $result);
- }
- }
|