Jelajahi Sumber

debug add oil

stanley-king 4 tahun lalu
induk
melakukan
6fed9721c7
2 mengubah file dengan 13 tambahan dan 7 penghapusan
  1. 3 3
      helper/model/member_info.php
  2. 10 4
      mobile/control/merchant_refill.php

+ 3 - 3
helper/model/member_info.php

@@ -26,11 +26,11 @@ class member_info
         else {
             $this->member_id = intval($member_id);
             $mod_member = Model('member');
-            $member_info = $mod_member->getMemberInfo($this->member_id);
-            if(empty($member_info)) {
+
+            $this->member_info = $mod_member->getMemberInfoByID($this->member_id);
+            if(empty($this->member_info)) {
                 throw new Exception("该用户不存在~", errcode::ErrMemberNotExist);
             }
-            $this->member_info = $member_info[0];
         }
     }
     public function available_predeposit() {

+ 10 - 4
mobile/control/merchant_refill.php

@@ -11,7 +11,8 @@ class merchant_refillControl extends mbMerchantControl
         parent::__construct();
     }
 
-    public function goodsOp(){
+    public function goodsOp()
+    {
         $goods = refill\RefillFactory::instance()->goods();
         $oil_amount = $phone_amount = [];
         foreach ($goods as $key => $value){
@@ -69,7 +70,8 @@ class merchant_refillControl extends mbMerchantControl
         return [true,""];
     }
 
-    public function addOp(){
+    public function addOp()
+    {
         $params = $_POST;
 
         $amount = intval($params['amount']);
@@ -78,11 +80,13 @@ class merchant_refillControl extends mbMerchantControl
         if(empty($card_no)){
             return self::outerr(errcode::ErrParamter, "卡号格式错误或未上传");
         }
+
         //成功个数、失败个数
         $success_no = $error_no = 0;
         $data = [];
         $all_no = count($card_no);
-        foreach ($card_no as $no){
+        foreach ($card_no as $no)
+        {
             $params['cardno'] = $no;
             [$success,$error] = $this->check_params($params);
 
@@ -90,7 +94,9 @@ class merchant_refillControl extends mbMerchantControl
                 $error_no++;
                 $arr['state'] = 201;
                 $arr['err'] = $error;
-            }else{
+            }
+            else
+            {
                 [$state,$err] = refill\RefillFactory::instance()->add($this->mchid(),$this->adminid(),$amount,$no,'','');
                 $arr['state'] = $state;
                 $arr['err'] = $err;