Selaa lähdekoodia

update merchant admin

ayHaru 4 vuotta sitten
vanhempi
commit
6e26fb9ee7

+ 5 - 0
mobile/control/merchant_info.php

@@ -220,6 +220,11 @@ class merchant_infoControl extends mbMerchantControl
     private function WeeksMerchantOrderStatistics($cond)
     {
         $data = [];
+        $begin = mktime(0, 0, 0, date('m'), date('d') - 7, date('Y'));
+        $end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
+        $cond['refill_order.order_time'] = ['between', [$begin, $end]];
+        $WeeksOrderStatistics = $this->MerchantOrderStatistics($cond);
+
         for ($i = 0; $i < 7; $i++) {
             $begin = mktime(0, 0, 0, date('m'), date('d') - $i, date('Y'));
             $end = mktime(0, 0, 0, date('m'), date('d') - $i + 1, date('Y')) - 1;

+ 0 - 1
mobile/control/merchant_login.php

@@ -35,7 +35,6 @@ class merchant_loginControl extends merchantwebControl
                 $mch_info['ips'] = unserialize($mch_info['ip_white_list']);
             }
             $_SESSION['mchid'] = $mch_info['mchid'];
-            $_SESSION['member_id'] = $mch_info['admin_id'];
 
             return self::outsuccess([]);
         } else {

+ 4 - 1
mobile/control/merchant_order.php

@@ -20,7 +20,7 @@ class merchant_orderControl extends mbMerchantControl
         if ($_GET['start_time'] > 0 && $_GET['end_time'] > 0) {
             $cond['refill_order.order_time'] = ['between', [$_GET['start_time'], $_GET['end_time']]];
         }
-        $fields = 'refill_order.order_id,refill_order.order_sn,refill_order.mchid,refill_order.card_no,refill_order.mch_order,refill_order.card_type,refill_order.order_time,refill_order.notify_time,refill_order.refill_amount,refill_order.mch_amount,vr_order.order_state';
+        $fields = 'refill_order.order_id,refill_order.order_sn,refill_order.mchid,refill_order.card_no,refill_order.mch_order,refill_order.card_type,refill_order.order_time,refill_order.notify_time,refill_order.refill_amount,refill_order.mch_amount,vr_order.order_state,refill_order.channel_name,refill_order.ch_trade_no';
         $order_list = $model_vr_order->getMerchantOrderList($cond, $this->page, $fields, 'refill_order.order_id desc');
         $order_list = $this->merchant_order_format($order_list);
         $result['data'] = $order_list;
@@ -38,6 +38,9 @@ class merchant_orderControl extends mbMerchantControl
             if (isset($order['notify_time'])) {
                 $order['notify_time'] = date('Y-m-d H:i:s', $order['notify_time']);
             }
+            if($order['channel_name'] != 'bjb'){
+                $order['ch_trade_no'] = '';
+            }
             $order['order_state_text'] = $this->_orderState($order['order_state']);
             $order['card_type_name'] = $this->scard_type($order['card_type']);
             $data[] = $order;

+ 8 - 2
mobile/control/merchant_refill.php

@@ -74,13 +74,19 @@ class merchant_refillControl extends mbMerchantControl
     {
         $params = $_POST;
 
+        $mchid = $this->mchid();
+        $model_merchant = Model('merchant');
+        $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid]);
+        if (empty($merchant_info)) {
+            return self::outerr(errcode::ErrMemberNotExist, "用户不存在.");
+        }
+
         $amount = intval($params['amount']);
         $card_no = trim($params['cardno']);
         $card_no = explode(',' , $card_no);
         if(empty($card_no)){
             return self::outerr(errcode::ErrParamter, "卡号格式错误或未上传");
         }
-
         //成功个数、失败个数
         $success_no = $error_no = 0;
         $data = [];
@@ -97,7 +103,7 @@ class merchant_refillControl extends mbMerchantControl
             }
             else
             {
-                [$state,$err] = refill\RefillFactory::instance()->add($this->mchid(),$this->adminid(),$amount,$no,'','');
+                [$state,$err] = refill\RefillFactory::instance()->add($mchid,$merchant_info['admin_id'],$amount,$no,'','');
                 $arr['state'] = $state;
                 $arr['err'] = $err;
                 if($state === true) {

+ 9 - 3
mobile/control/refill_evidence.php

@@ -38,14 +38,20 @@ class refill_evidenceControl extends mbMerchantControl
         if (!isset($params['voucher']) || empty($params['voucher'])) {
             return self::outerr(errcode::ErrParamter, "凭证名称有误");
         }
+        $mchid = $this->mchid();
+        $model_merchant = Model('merchant');
+        $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid]);
+        if (empty($merchant_info)) {
+            return self::outerr(errcode::ErrMemberNotExist, "用户不存在.");
+        }
         $ins['amount'] = $params['amount'];
         $ins['bank_username'] = $params['bank_username'];
         $ins['bank_name'] = $params['bank_name'];
         $ins['voucher_name'] = $params['voucher'];
-        $ins['mchid'] = $this->mchid();
-        $ins['member_id'] = $this->adminid();
+        $ins['mchid'] = $mchid;
+        $ins['mch_name'] = $merchant_info['name'];
+        $ins['member_id'] = $merchant_info['admin_id'];
         $ins['add_time'] = time();
-        $model_merchant = Model('merchant');
         $ret = $model_merchant->addRefillEvidence($ins);
         if ($ret) {
             return self::outsuccess([]);