|
@@ -159,19 +159,28 @@ class merchantControl extends SystemControl
|
|
|
$card_types = $_POST['cardtype'];
|
|
|
$specs = $_POST['spec'];
|
|
|
$prices = $_POST['price'];
|
|
|
+ $amount_limit = $_POST['amount_limit'];
|
|
|
foreach ($card_types as $key => $card_type) {
|
|
|
$data['card_type'] = $card_type;
|
|
|
$data['spec'] = intval($specs[$key]);
|
|
|
$data['price'] = number_format($prices[$key], 2, '.', '');
|
|
|
+ $data['amount_limit'] = $amount_limit[$key];
|
|
|
$params[] = $data;
|
|
|
}
|
|
|
foreach ($params as $param) {
|
|
|
- $insert['mchid'] = $mchid;
|
|
|
- $insert['spec'] = $param['spec'];
|
|
|
- $insert['price'] = $param['price'];
|
|
|
- $insert['card_type'] = $param['card_type'];
|
|
|
-
|
|
|
- $inserts[] = $insert;
|
|
|
+ if($param['price'] > 0)
|
|
|
+ {
|
|
|
+ $insert['mchid'] = $mchid;
|
|
|
+ $insert['spec'] = $param['spec'];
|
|
|
+ $insert['price'] = $param['price'];
|
|
|
+ $insert['card_types'] = $param['card_type'];
|
|
|
+ $insert['amount_limit'] = $param['amount_limit'];
|
|
|
+ $inserts[] = $insert;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(empty($inserts))
|
|
|
+ {
|
|
|
+ showMessage('操作成功', 'index.php?act=merchant&op=merchant');
|
|
|
}
|
|
|
$model_merchant = Model('merchant');
|
|
|
try {
|
|
@@ -218,10 +227,13 @@ class merchantControl extends SystemControl
|
|
|
$data['goods_name'] = $goods_name;
|
|
|
$data['card_type'] = $key;
|
|
|
$data['spec'] = $amount;
|
|
|
+ $data['amount_limit'] = -1;
|
|
|
$data['price'] = 0;
|
|
|
foreach ($items as $item) {
|
|
|
- if ($amount == $item['spec'] && $key == $item['card_type']) {
|
|
|
+ $item['types'] = explode(',' , $item['card_types']);
|
|
|
+ if ($amount == $item['spec'] && in_array($key , $item['types'])) {
|
|
|
$data['price'] = $item['price'];
|
|
|
+ $data['amount_limit'] = $item['amount_limit'];
|
|
|
}
|
|
|
}
|
|
|
$result[] = $data;
|
|
@@ -565,6 +577,13 @@ class merchantControl extends SystemControl
|
|
|
Tpl::showpage('refill.order.index');
|
|
|
}
|
|
|
|
|
|
+ public function notify_merchantOp()
|
|
|
+ {
|
|
|
+ $order_id = $_GET['order_id'];
|
|
|
+ QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id]);
|
|
|
+ showMessage('操作成功', 'index.php?act=merchant&op=refill_order');
|
|
|
+ }
|
|
|
+
|
|
|
public function providerOp()
|
|
|
{
|
|
|
$this->sync_cfgs();
|