소스 검색

增加运营人员调整渠道价格

stanley-king 3 년 전
부모
커밋
a2ffee1f01
3개의 변경된 파일27개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 0
      admin/control/provider_price.php
  2. 20 0
      data/logic/queue.logic.php
  3. 0 2
      helper/refill/chprice_helper.php

+ 7 - 0
admin/control/provider_price.php

@@ -1,5 +1,9 @@
 <?php
+
+use refill\chprice_helper;
+
 include(BASE_CONFIG_PATH . CONFIG_PREFIX . '/refill.ini.php');
+require_once(BASE_HELPER_PATH . '/refill/chprice_helper.php');
 
 class provider_priceControl extends SystemControl
 {
@@ -11,6 +15,9 @@ class provider_priceControl extends SystemControl
     public function indexOp()
     {
         global $config;
+        $chprice_helper = new chprice_helper();
+        $chprice_helper->load_from_db();
+
         $card_type = $_GET['card_type'] ?? mtopcard\PhoneCardPaper;
         if ($card_type == mtopcard\OilCardPaper) {
             $configs = $this->map_cfg($config['oil_providers']);

+ 20 - 0
data/logic/queue.logic.php

@@ -8,6 +8,9 @@
  *
 
  */
+
+use refill\chprice_helper;
+
 defined('InShopNC') or exit('Access Invalid!');
 
 require_once(BASE_HELPER_PATH . '/push_sender.php');
@@ -31,6 +34,7 @@ require_once(BASE_HELPER_PATH . '/mcard/mcard.php');
 require_once(BASE_HELPER_PATH . '/util_helper.php');
 require_once(BASE_HELPER_PATH . '/third_author/signaturer.php');
 require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
+require_once(BASE_HELPER_PATH . '/refill/chprice_helper.php');
 
 
 class queueLogic
@@ -1437,4 +1441,20 @@ class queueLogic
             return callback($ret, "放入通知队列 ret = {$ret}",$params);
         }
     }
+
+    public function AysncChangePrice($params)
+    {
+        $price_id = intval($params['price_id']);
+        if($price_id > 0) {
+
+            $chprice_helper = new chprice_helper();
+            $chprice_helper->effect($price_id);
+
+            $publisher = new message\publisher();
+            $publisher->modify_refill_channel();
+            return callback(true, "成功更新价格",$params);
+        } else {
+            return callback(false, 'AysncChangePrice 参数为空');
+        }
+    }
 }

+ 0 - 2
helper/refill/chprice_helper.php

@@ -146,8 +146,6 @@ class chprice_helper
 
     public function load_from_db()
     {
-        include(BASE_CONFIG_PATH . CONFIG_PREFIX . '/refill.ini.php');
-
         global $config;
         $config['oil_providers'] = $this->load_type(mtopcard\OilCardPaper);
         $config['phone_providers'] = $this->load_type(mtopcard\PhoneCardPaper);