소스 검색

fix fcode

stanley-king 7 년 전
부모
커밋
44785ee9c0
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      helper/fcode/mfcode.php
  2. 2 0
      mobile/control/fcode.php

+ 4 - 1
helper/fcode/mfcode.php

@@ -65,7 +65,10 @@ class mfcode
         $result = [];
         $result['fcode_id'] = $this->fc_id();
 
-        $result['goods_id'] = commonid_helper::instance()->one_goods($this->commonid());
+        $goods_id = commonid_helper::instance()->one_goods($this->commonid());
+        if($goods_id == false) return;
+
+        $result['goods_id'] = $goods_id;
         $result['fcode']    = $this->fcode();
         $result['key']      = $this->user_key();
         $result['usable_time'] = $this->usable_time();

+ 2 - 0
mobile/control/fcode.php

@@ -82,6 +82,8 @@ class fcodeControl extends mobileControl
     private function goods($common_id)
     {
         $goods_id = commonid_helper::instance()->one_goods($common_id);
+        if($goods_id == false) return [];
+
         $mod = Model('goods');
         $goods = $mod->find($goods_id);