瀏覽代碼

修复红包余额为0时,也发过期通知问题

stanley-king 8 年之前
父節點
當前提交
4f576a4b4d

+ 0 - 3
data/api/notification/UmengNotification.php

@@ -70,7 +70,6 @@ abstract class UmengNotification {
 	function send() {
 		//check the fields to make sure that they are not NULL
     	$this->isComplete();
-
         $url = $this->host . $this->postPath;
         $postBody = json_encode($this->data);
         $sign = md5("POST" . $url . $postBody . $this->appMasterSecret);
@@ -87,7 +86,6 @@ abstract class UmengNotification {
         $curlErrNo = curl_errno($ch);
         $curlErr = curl_error($ch);
         curl_close($ch);
-     //   print($result . "\r\n");
         if ($httpCode == "0") {
           	 // Time out
            	throw new Exception("Curl error number:" . $curlErrNo . " , Curl error details:" . $curlErr . "\r\n");
@@ -98,5 +96,4 @@ abstract class UmengNotification {
            	return $result;
         }
     }
-	
 }

+ 2 - 1
data/model/user_bonus.model.php

@@ -242,6 +242,7 @@ class user_bonusModel extends Model
         $cond['usable_time'] = array(array('gt',$cur_time), array('elt',$cur_time + $left_warn_secs),'and');
         $cond['notify_time'] = array(array('eq',0), array('elt',$cur_time - $period_secs),'or');
         $cond['expired'] = 0;
+        $cond['remain_amount'] = array('gt','0.00');
 
         $ret = $this->getBonusList($cond,'*');
         if(empty($ret)) {
@@ -253,7 +254,7 @@ class user_bonusModel extends Model
 
     public function getExpired()
     {
-        $cond = array('expired' => 0, 'bonus_status' => 3,'usable_time' => array('elt',time()));
+        $cond = array('expired' => 0, 'remain_amount' => array('gt','0.00'),'bonus_status' => 3,'usable_time' => array('elt',time()));
         $ret = $this->getBonusList($cond,"*");
 
         return $ret;

+ 5 - 5
mobile/control/member_bonus.php

@@ -232,20 +232,20 @@ class member_bonusControl extends mbMemberControl
     private function show_type($make_type)
     {
         switch ($make_type) {
-            case bonus\type::MakeSendType:
+            case bonus\type::MakeSendType: //抢
                 return 1;
-            case bonus\type::MakeBonusRefundType:
+            case bonus\type::MakeBonusRefundType: //退
             case bonus\type::MakePayRefundType:
             case bonus\type::MakeOrderCancelType:
                 return 2;
-            case bonus\type::MakeShakeGainType:
+            case bonus\type::MakeShakeGainType: //摇
             case bonus\type::MakeShakeLostType:
                 return 3;
-            case bonus\type::MakePayType:
+            case bonus\type::MakePayType:   //赠
             case bonus\type::MakeRegister:
                 return 4;
             default:
-                return 0;
+                return 0;   //什么都不显示
         }
     }
 

+ 6 - 0
test/bonus_helperTest.php

@@ -12,6 +12,7 @@ define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
 require_once(BASE_ROOT_PATH . '/fooder.php');
 require_once(BASE_ROOT_PATH . '/helper/bonus_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/bonus/witholder.php');
+require_once(BASE_ROOT_PATH . '/helper/notify_helper.php');
 
 
 
@@ -33,6 +34,11 @@ class bonus_helperTest extends PHPUnit_Framework_TestCase
         $mem_bonus = new \bonus\witholder(36490);
         $mem_bonus->withold(7.30);
     }
+
+    public function testExpire()
+    {
+        notify_helper::bonus_expired();
+    }
     public function testPush()
     {