|
@@ -9,7 +9,6 @@ defined('InShopNC') or exit('Access Invalid!');
|
|
|
require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
|
|
|
require_once(BASE_CONFIG_PATH . CONFIG_PREFIX . '/refill.ini.php');
|
|
|
|
|
|
-
|
|
|
class merchantControl extends SystemControl
|
|
|
{
|
|
|
const EXPORT_SIZE = 1000;
|
|
@@ -207,6 +206,62 @@ class merchantControl extends SystemControl
|
|
|
return [true, 'success'];
|
|
|
}
|
|
|
|
|
|
+ public function oilAmountLockOp()
|
|
|
+ {
|
|
|
+ $turn_name = 'oil_amount_lock_turn';
|
|
|
+
|
|
|
+ if(chksubmit())
|
|
|
+ {
|
|
|
+ $lock_opened = $_POST['lock_opened'];
|
|
|
+ if(!in_array($lock_opened, [0,1])) {
|
|
|
+ showMessage('开启状态有误', '');
|
|
|
+ }
|
|
|
+ if($lock_opened == 1) {
|
|
|
+ wkcache($turn_name, true);
|
|
|
+ } elseif ($lock_opened == 0) {
|
|
|
+ wkcache($turn_name, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ $mchids = $_POST['mchid'];
|
|
|
+ $change_amounts = $_POST['change'];
|
|
|
+ foreach ($mchids as $key => $mchid)
|
|
|
+ {
|
|
|
+ $mchid = intval($mchid);
|
|
|
+ $amount = $change_amounts[$key];
|
|
|
+ if(!empty($amount)){
|
|
|
+ refill\util::set_amount_lock($mchid, $amount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ showMessage('编辑成功', 'index.php?act=merchant&op=merchant');
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $lock_opened = rkcache($turn_name);
|
|
|
+
|
|
|
+ $model_merchant = Model('merchant');
|
|
|
+ $merchant_list = $model_merchant->getMerchantList([], 1000, 'mchid asc', 'mchid,company_name');
|
|
|
+ $result = $data = [];
|
|
|
+ foreach ($merchant_list as $merchant)
|
|
|
+ {
|
|
|
+ $mchid = intval($merchant['mchid']);
|
|
|
+ $amount_lock = \refill\util::get_amount_lock($mchid);
|
|
|
+ Log::record("mchid: {$mchid}, amount_lock: {$amount_lock}", Log::DEBUG);
|
|
|
+ $result['mchid'] = $mchid;
|
|
|
+ if (!empty($amount_lock)) {
|
|
|
+ $result['amount'] = $amount_lock;
|
|
|
+ } else {
|
|
|
+ $result['amount'] = 0;
|
|
|
+ }
|
|
|
+ $result['company_name'] = $merchant['company_name'];
|
|
|
+ $data[] = $result;
|
|
|
+ }
|
|
|
+
|
|
|
+ Tpl::output('data', $data);
|
|
|
+ Tpl::output('lock_opened', $lock_opened);
|
|
|
+ Tpl::showpage('oil.amount.lock');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function orderStorgeOp()
|
|
|
{
|
|
|
if (chksubmit()) {
|
|
@@ -897,7 +952,7 @@ class merchantControl extends SystemControl
|
|
|
->field('refill_provider.*,store.store_name')
|
|
|
->join('inner')
|
|
|
->on('store.store_id=refill_provider.store_id')
|
|
|
- ->where(['refill_provider.opened' => 1])
|
|
|
+ ->order('opened asc, provider_id desc')
|
|
|
->limit(1000)
|
|
|
->select();
|
|
|
|
|
@@ -1406,12 +1461,19 @@ class merchantControl extends SystemControl
|
|
|
foreach ($merchant_list as $key => $value) {
|
|
|
$merchants[$value['mchid']] = $value;
|
|
|
}
|
|
|
+ $_GET['card_type'] = $_GET['card_type'] ?? 'phone';
|
|
|
if ($_GET['time'] == 1) {
|
|
|
$condition['refill_order.order_time'] = ['between', [(time() - 3600), (time() - 1800)]];
|
|
|
}
|
|
|
if ($_GET['time'] == 2) {
|
|
|
$condition['refill_order.order_time'] = ['lt', (time() - 3600)];
|
|
|
}
|
|
|
+ if ($_GET['card_type'] == 'oil') {
|
|
|
+ $condition['refill_order.card_type'] = ['in', ['1', '2']];
|
|
|
+ }
|
|
|
+ if ($_GET['card_type'] == 'phone') {
|
|
|
+ $condition['refill_order.card_type'] = ['in', ['4', '5', '6']];
|
|
|
+ }
|
|
|
|
|
|
$order_list = $model_refill_order->getMerchantOrderList($condition, 100, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
|
|
|
|
|
@@ -1570,17 +1632,17 @@ class merchantControl extends SystemControl
|
|
|
if ($money == 0) {
|
|
|
showMessage('申请金额错误');
|
|
|
}
|
|
|
- if(empty($_FILES['voucher']['name'])) {
|
|
|
- showMessage('未上传充值申请凭证');
|
|
|
- }
|
|
|
- $upload = new UploadFile();
|
|
|
- $upload->set('default_dir',ATTACH_UPFILE.'/provider');
|
|
|
-
|
|
|
- $result = $upload->upfile('voucher');
|
|
|
- if ($result){
|
|
|
- $_POST['voucher'] = $upload->file_name;
|
|
|
- }else {
|
|
|
- showMessage($upload->error);
|
|
|
+ if(!empty($_FILES['voucher']['name'])) {
|
|
|
+ $upload = new UploadFile();
|
|
|
+ $upload->set('default_dir',ATTACH_UPFILE.'/provider');
|
|
|
+
|
|
|
+ $result = $upload->upfile('voucher');
|
|
|
+ if ($result){
|
|
|
+ $_POST['voucher'] = $upload->file_name;
|
|
|
+ $input['voucher_name'] = $_POST['voucher'];
|
|
|
+ }else {
|
|
|
+ showMessage($upload->error);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$input['store_name'] = $provider_info['store_name'];
|
|
@@ -1590,7 +1652,6 @@ class merchantControl extends SystemControl
|
|
|
$input['bank_name'] = $_POST['bank_name'];
|
|
|
$input['to_bank_username'] = $_POST['to_bank_username'];
|
|
|
$input['to_bank_name'] = $_POST['to_bank_name'];
|
|
|
- $input['voucher_name'] = $_POST['voucher'];
|
|
|
$input['add_time'] = time();
|
|
|
$mod = Model('provider_evidence');
|
|
|
$res = $mod->addProviderEvidence($input);
|