Преглед изворни кода

admin update price and add refill order notify

ayHaru пре 4 година
родитељ
комит
2caf8caaad

+ 26 - 7
admin/control/merchant.php

@@ -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();

+ 5 - 0
admin/templates/default/merchant.price.php

@@ -120,6 +120,7 @@
                                 </div>
                             </div>
                         </th>
+                        <th class="w150 align-center">每日额度</th>
                     </tr>
                     <tbody class="tbody">
                     <?php if (!empty($output['goods']) && is_array($output['goods'])) { ?>
@@ -137,6 +138,10 @@
                                     <input type="text" name="price[]" class="txt val"
                                            value="<?php echo $v['price']; ?>">
                                 </td>
+                                <td class="w150 align-center">
+                                    <input type="text" name="amount_limit[]" value="<?php echo $v['amount_limit']; ?>">
+                                    <input type="hidden" name="amount_limit[]" value="<?php echo $v['amount_limit']; ?>">
+                                </td>
                             </tr>
                         <?php } ?>
                     <?php } ?>

+ 3 - 14
admin/templates/default/refill.order.index.php

@@ -140,21 +140,10 @@
                     <td class="align-left"><?php echo $order['ch_trade_no']; ?></td>
                     <td class="align-center"><?php echo $order['channel_name']; ?></td>
                     <td class="w144 align-center">
-<!--                        <a href="index.php?act=order&op=show_order&order_id=--><?php //echo $order['order_id']; ?><!--">--><?php //echo $lang['nc_view']; ?><!--</a>-->
-                        <!-- 取消订单 -->
-                        <?php if ($order['if_cancel']) { ?>
-                            | <a href="javascript:void(0)"
-                                 onclick="if(confirm('<?php echo $lang['order_confirm_cancel']; ?>')){location.href='index.php?act=order&op=change_state&state_type=cancel&order_id=<?php echo $order['order_id']; ?>'}">
-                                <?php echo $lang['order_change_cancel']; ?></a>
-                        <?php } ?>
-
-                        <!-- 收款 -->
-                        <?php if ($order['if_system_receive_pay']) { ?>
-                            |
-                            <a href="index.php?act=order&op=change_state&state_type=receive_pay&order_id=<?php echo $order['order_id']; ?>">
-                                <?php echo $lang['order_change_received']; ?></a>
-                        <?php } ?>
+                        <a href="index.php?act=order&op=notify_merchant&order_id=<?php echo $order['order_id']; ?>">
+                                回调</a>
                     </td>
+
                 </tr>
             <?php } ?>
         <?php } else { ?>