|
@@ -14,24 +14,27 @@ class providerControl extends SystemControl
|
|
|
$provider_model = Model('refill_provider');
|
|
|
$condition = [];
|
|
|
if (trim($_GET['name']) != '') {
|
|
|
- $condition['name'] = ['like', '%' . $_GET['name'] . '%'];
|
|
|
+ $condition['store_name'] = ['like', '%' . $_GET['name'] . '%'];
|
|
|
Tpl::output('name', $_GET['name']);
|
|
|
}
|
|
|
if (in_array($_GET['type'], [1, 2])) {
|
|
|
$condition['type'] = $_GET['type'];
|
|
|
}
|
|
|
- $store_list = Model('store')->getStoreList(['store_id' => ['gt',0]], '', '', 'store_id,store_name');
|
|
|
- foreach ($store_list as $store) {
|
|
|
- $stores[$store['store_id']] = $store['store_name'];
|
|
|
- }
|
|
|
- $provider_list = $provider_model->getProviderList($condition, 100, '*', 'opened asc , name asc');
|
|
|
+
|
|
|
+ $provider_list = $provider_model->table('refill_provider,store')
|
|
|
+ ->field('refill_provider.*,store.store_name')
|
|
|
+ ->join('inner')
|
|
|
+ ->on('store.store_id=refill_provider.store_id')
|
|
|
+ ->where($condition)
|
|
|
+ ->order('opened asc, name asc')
|
|
|
+ ->page(10)
|
|
|
+ ->select();
|
|
|
foreach ($provider_list as $key => $provider) {
|
|
|
if (!empty($provider['start_period']) && !empty($provider['end_period'])) {
|
|
|
$provider_list[$key]['period'] = $provider['start_period'] . '~' . $provider['end_period'];
|
|
|
} else {
|
|
|
$provider_list[$key]['period'] = '全时间段';
|
|
|
}
|
|
|
- $provider_list[$key]['store_name'] = $stores[$provider['store_id']];
|
|
|
}
|
|
|
$opened_text = ['使用中', '已禁用'];
|
|
|
$type_text = ['油卡', '手机充值卡', '增值业务'];
|