|
@@ -654,6 +654,10 @@ class merchantControl extends SystemControl
|
|
$condition['refill_order.channel_name'] = $_GET['channel_name'];
|
|
$condition['refill_order.channel_name'] = $_GET['channel_name'];
|
|
unset($condition['refill_order.order_time']);
|
|
unset($condition['refill_order.order_time']);
|
|
}
|
|
}
|
|
|
|
+ if (!empty($_GET['store_id'])) {
|
|
|
|
+ $condition['vr_order.store_id'] = $_GET['store_id'];
|
|
|
|
+ unset($condition['refill_order.order_time']);
|
|
|
|
+ }
|
|
if (!empty($_GET['card_type'])) {
|
|
if (!empty($_GET['card_type'])) {
|
|
if(in_array($_GET['card_type'] , ['1' , '2' , '4' , '5' , '6'])) {
|
|
if(in_array($_GET['card_type'] , ['1' , '2' , '4' , '5' , '6'])) {
|
|
$condition['refill_order.card_type'] = $_GET['card_type'];
|
|
$condition['refill_order.card_type'] = $_GET['card_type'];
|
|
@@ -676,11 +680,11 @@ class merchantControl extends SystemControl
|
|
if (in_array($_GET['refill_amount'], ['10', '20', '30', '50' , '100', '200', '300', '500' , '1000', '20000'])) {
|
|
if (in_array($_GET['refill_amount'], ['10', '20', '30', '50' , '100', '200', '300', '500' , '1000', '20000'])) {
|
|
$condition['refill_order.refill_amount'] = $_GET['refill_amount'];
|
|
$condition['refill_order.refill_amount'] = $_GET['refill_amount'];
|
|
}
|
|
}
|
|
- $if_start_time = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $_GET['query_start_time']);
|
|
|
|
- $if_end_time = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $_GET['query_end_time']);
|
|
|
|
- $start_unixtime = $if_start_time ? strtotime($_GET['query_start_time']) : null;
|
|
|
|
- $end_unixtime = $if_end_time ? strtotime($_GET['query_end_time']) : null;
|
|
|
|
- if ($start_unixtime || $end_unixtime) {
|
|
|
|
|
|
+
|
|
|
|
+ $start_unixtime = strtotime($_GET['query_start_time']);
|
|
|
|
+ $end_unixtime = strtotime($_GET['query_end_time']);
|
|
|
|
+
|
|
|
|
+ if ($start_unixtime >0 && $end_unixtime >0) {
|
|
$condition['refill_order.order_time'] = ['time', [$start_unixtime, $end_unixtime]];
|
|
$condition['refill_order.order_time'] = ['time', [$start_unixtime, $end_unixtime]];
|
|
}
|
|
}
|
|
if (in_array($_GET['order_state'], ['0', '10', '20', '30', '40'])) {
|
|
if (in_array($_GET['order_state'], ['0', '10', '20', '30', '40'])) {
|
|
@@ -720,9 +724,11 @@ class merchantControl extends SystemControl
|
|
$order_list[$order_id]['diff_time'] = time() - $order_info['order_time'];
|
|
$order_list[$order_id]['diff_time'] = time() - $order_info['order_time'];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ $provider_list = Model('')->table('refill_provider')->limit(100)->select();
|
|
Tpl::output('stat', $stat[0]);
|
|
Tpl::output('stat', $stat[0]);
|
|
Tpl::output('count', $count);
|
|
Tpl::output('count', $count);
|
|
Tpl::output('order_list', $order_list);
|
|
Tpl::output('order_list', $order_list);
|
|
|
|
+ Tpl::output('provider_list', $provider_list);
|
|
Tpl::output('show_page', $model_refill_order->showpage());
|
|
Tpl::output('show_page', $model_refill_order->showpage());
|
|
Tpl::showpage('refill.order.index');
|
|
Tpl::showpage('refill.order.index');
|
|
}
|
|
}
|
|
@@ -759,6 +765,20 @@ class merchantControl extends SystemControl
|
|
showMessage('操作成功', 'index.php?act=merchant&op=refill_order');
|
|
showMessage('操作成功', 'index.php?act=merchant&op=refill_order');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function providerStatsOp()
|
|
|
|
+ {
|
|
|
|
+ $provider_model = Model('refill_provider');
|
|
|
|
+ $condition = [];
|
|
|
|
+ $provider_list = $provider_model->getProviderList($condition, 100);
|
|
|
|
+ $opened_text = ['使用中', '已禁用'];
|
|
|
|
+ $type_text = ['油卡', '手机充值卡'];
|
|
|
|
+ Tpl::output('opened_text', $opened_text);
|
|
|
|
+ Tpl::output('type_text', $type_text);
|
|
|
|
+ Tpl::output('provider_list', $provider_list);
|
|
|
|
+ Tpl::output('show_page', $provider_model->showpage());
|
|
|
|
+ Tpl::showpage('provider.stats');
|
|
|
|
+ }
|
|
|
|
+
|
|
public function providerOp()
|
|
public function providerOp()
|
|
{
|
|
{
|
|
$this->sync_cfgs();
|
|
$this->sync_cfgs();
|
|
@@ -771,7 +791,7 @@ class merchantControl extends SystemControl
|
|
if (in_array($_GET['type'], [1, 2])) {
|
|
if (in_array($_GET['type'], [1, 2])) {
|
|
$condition['type'] = $_GET['type'];
|
|
$condition['type'] = $_GET['type'];
|
|
}
|
|
}
|
|
- $provider_list = $provider_model->getProviderList($condition, 25);
|
|
|
|
|
|
+ $provider_list = $provider_model->getProviderList($condition, 100);
|
|
foreach ($provider_list as $key => $provider) {
|
|
foreach ($provider_list as $key => $provider) {
|
|
if(!empty($provider['start_period']) && !empty($provider['end_period'])){
|
|
if(!empty($provider['start_period']) && !empty($provider['end_period'])){
|
|
$provider_list[$key]['period'] = $provider['start_period'] . '~' . $provider['end_period'];
|
|
$provider_list[$key]['period'] = $provider['start_period'] . '~' . $provider['end_period'];
|
|
@@ -801,20 +821,23 @@ class merchantControl extends SystemControl
|
|
|
|
|
|
$match = function ($all,$cur)
|
|
$match = function ($all,$cur)
|
|
{
|
|
{
|
|
- $insert = [];
|
|
|
|
|
|
+ $inserts = [];
|
|
foreach ($all as $key => $value)
|
|
foreach ($all as $key => $value)
|
|
{
|
|
{
|
|
|
|
+
|
|
if(!array_key_exists($key,$cur)) {
|
|
if(!array_key_exists($key,$cur)) {
|
|
- $insert[] = $key;
|
|
|
|
|
|
+ $insert['name'] = $key;
|
|
|
|
+ $insert['store_id'] = $value['cfg']['store_id'];
|
|
|
|
+ $inserts[] = $insert;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return $insert;
|
|
|
|
|
|
+ return $inserts;
|
|
};
|
|
};
|
|
|
|
|
|
$inserter = function ($mod,$type,$names)
|
|
$inserter = function ($mod,$type,$names)
|
|
{
|
|
{
|
|
foreach ($names as $name) {
|
|
foreach ($names as $name) {
|
|
- $data = ['name' => $name,'type' => $type];
|
|
|
|
|
|
+ $data = ['name' => $name['name'],'type' => $type,'store_id' => $name['store_id']];
|
|
$mod->insert($data);
|
|
$mod->insert($data);
|
|
}
|
|
}
|
|
};
|
|
};
|