|
@@ -26,6 +26,9 @@ class providerControl extends SystemControl
|
|
|
if(!empty($_GET['quality'])) {
|
|
|
$condition['qualitys'] = ['like', '%' . $_GET['quality'] . '%'];
|
|
|
}
|
|
|
+ if(!empty($_GET['export'])) {
|
|
|
+ $condition['opened'] = 1;
|
|
|
+ }
|
|
|
|
|
|
$provider_items = $provider_model->table('refill_provider,store')
|
|
|
->field('refill_provider.*,store.store_name,store.member_id')
|
|
@@ -73,6 +76,11 @@ class providerControl extends SystemControl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if(!empty($_GET['export']))
|
|
|
+ {
|
|
|
+ $this->provider_export($providers);
|
|
|
+ return;
|
|
|
+ }
|
|
|
$stats = ['available_total' => $available_total, 'debt_total' => $debt_total];
|
|
|
$opened_text = ['使用中', '已禁用'];
|
|
|
$type_text = ['油卡', '手机充值卡', '增值业务'];
|
|
@@ -584,37 +592,10 @@ class providerControl extends SystemControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function provider_exportOp()
|
|
|
+ public function provider_export($providers)
|
|
|
{
|
|
|
Language::read('export');
|
|
|
import('libraries.excel');
|
|
|
- $cond['opened'] = 1;
|
|
|
- $provider_items = $this->providers($cond);
|
|
|
- $mid_pids = [];
|
|
|
- $mids = [];
|
|
|
- foreach ($provider_items as $provider)
|
|
|
- {
|
|
|
- $pid = $provider['provider_id'];
|
|
|
- $providers[$pid] = $provider;
|
|
|
- $providers[$pid]['available_predeposit'] = 0;
|
|
|
- $account_id = intval($provider['account_id']);
|
|
|
- if($account_id > 0) {
|
|
|
- $mid_pids[$account_id] = $pid;
|
|
|
- $mids[] = $account_id;
|
|
|
- }
|
|
|
- }
|
|
|
- if(!empty($mids))
|
|
|
- {
|
|
|
- $member_data = Model('member')->field('member_id,available_predeposit')->where(['member_id' => ['in', $mids]])->select();
|
|
|
- foreach ($member_data as $member)
|
|
|
- {
|
|
|
- $mid = intval($member['member_id']);
|
|
|
- if (array_key_exists($mid, $mid_pids)) {
|
|
|
- $pid = $mid_pids[$mid];
|
|
|
- $providers[$pid]['available_predeposit'] = $member['available_predeposit'];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
$excel_obj = new Excel();
|
|
|
$excel_data = [];
|
|
|
//设置样式
|