|
@@ -172,13 +172,50 @@ class push_helper
|
|
|
return "{$amount}元{$desc}";
|
|
|
}
|
|
|
|
|
|
+ private static function push($alias, $push_param, $sms_type='',$sms_param=[], $fQueue=false)
|
|
|
+ {
|
|
|
+ $alias_info = new member_info($alias);
|
|
|
+ $mobile = $alias_info->mobile();
|
|
|
+ $client_type = $alias_info->client_type();
|
|
|
+
|
|
|
+ if($fQueue)
|
|
|
+ {
|
|
|
+ if($client_type > 0) {
|
|
|
+ QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(!empty($sms_type)) {
|
|
|
+ $sms_param['mobile'] = $mobile;
|
|
|
+ $sms_param['type'] = $sms_type;
|
|
|
+ QueueClient::push('sendSMS',$sms_param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if($client_type > 0) {
|
|
|
+ $push = new push_sender();
|
|
|
+ $status = $push->send($push_param,$client_type);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(!empty($sms_type)) {
|
|
|
+ $sms = new Sms();
|
|
|
+ $status = $sms->send_oper($mobile,$sms_type,$sms_param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private static function inviter_text(member_info $invitee, $level, $money, $rate)
|
|
|
{
|
|
|
$nickname = $invitee->nickname();
|
|
|
$text = self::money_rate_desc($money, $rate);
|
|
|
return "{$nickname} 成为您的{$level}度粉丝,您获得{$text}红包奖励.";
|
|
|
}
|
|
|
- public static function inviter_bonus($inviter, $user, $level, $money, $rate, $type_sn)
|
|
|
+
|
|
|
+ public static function inviter_bonus($inviter, $user, $level, $money, $rate, $type_sn,$fQueue=false)
|
|
|
{
|
|
|
$user_info = new member_info($user);
|
|
|
$text = self::inviter_text($user_info,$level,$money,$rate);
|
|
@@ -195,7 +232,7 @@ class push_helper
|
|
|
$push_param['extra']['url'] = schema_helper::bonus_detail($type_sn);
|
|
|
$push_param['extra']['image'] = $user_info->avatar();
|
|
|
|
|
|
- QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ self::push($inviter,$push_param,Sms::tpl_reg_inviter,['user_name' => $user_info->nickname(),'level','amount' => $money],$fQueue);
|
|
|
}
|
|
|
|
|
|
private static function invitee_text(member_info $inviter, member_info $user, $level, $money, $rate)
|
|
@@ -205,7 +242,7 @@ class push_helper
|
|
|
return $text;
|
|
|
}
|
|
|
|
|
|
- public static function invitee_bonus($inviter, $invitee,member_info $user,$level, $money, $rate, $type_sn)
|
|
|
+ public static function invitee_bonus($inviter, $invitee,member_info $user,$level, $money, $rate, $type_sn,$fQueue=false)
|
|
|
{
|
|
|
$inviter_info = new member_info($inviter);
|
|
|
|
|
@@ -223,7 +260,7 @@ class push_helper
|
|
|
$push_param['extra']['url'] = schema_helper::bonus_detail($type_sn);
|
|
|
$push_param['extra']['image'] = $inviter_info->avatar();
|
|
|
|
|
|
- QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ self::push($invitee,$push_param,Sms::tpl_reg_invitee,['user_name' => $user->nickname(),'inviter_name' => $inviter_info->nickname(),'level','amount' => $money],$fQueue);
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -232,7 +269,7 @@ class push_helper
|
|
|
$text = "您的{$level}度粉丝 {$user->nickname()},刚刚购买了《{$goods_name}》.";
|
|
|
return $text;
|
|
|
}
|
|
|
- public static function inviter_order_paied($inviter, $user, $level, $goods_info)
|
|
|
+ public static function inviter_order_paied($inviter, $user, $level, $goods_info,$fQueue=false)
|
|
|
{
|
|
|
$user_info = new member_info($user);
|
|
|
$text = self::buygoods_inviter_text($user_info,$level,$goods_info['goods_name']);
|
|
@@ -249,7 +286,7 @@ class push_helper
|
|
|
$push_param['extra']['url'] = schema_helper::goods($goods_info['goods_id']);
|
|
|
$push_param['extra']['image'] = $goods_info['goods_image'];
|
|
|
|
|
|
- QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ self::push($inviter,$push_param);
|
|
|
}
|
|
|
|
|
|
private static function buygoods_invitee_text(member_info $user, $goods_name)
|
|
@@ -274,7 +311,7 @@ class push_helper
|
|
|
$push_param['extra']['url'] = schema_helper::goods($goods_info['goods_id']);
|
|
|
$push_param['extra']['image'] = $goods_info['goods_image'];
|
|
|
|
|
|
- QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ self::push($invitee,$push_param);
|
|
|
}
|
|
|
|
|
|
public static function user_order_paied($user, $paysn)
|
|
@@ -292,7 +329,7 @@ class push_helper
|
|
|
$push_param['extra']['url'] = schema_helper::order_info($paysn);
|
|
|
$push_param['extra']['image'] = self::admin_avatar();
|
|
|
|
|
|
- QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ self::push($user,$push_param);
|
|
|
}
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
public static function user_order_complete_fixed($user, $money, $rate, $type_sn)
|
|
@@ -312,7 +349,7 @@ class push_helper
|
|
|
$push_param['extra']['url'] = schema_helper::bonus_detail($type_sn);
|
|
|
$push_param['extra']['image'] = self::admin_avatar();
|
|
|
|
|
|
- QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ self::push($user,$push_param);
|
|
|
}
|
|
|
|
|
|
public static function user_order_complete_random($user,$num,$type_sn)
|
|
@@ -331,7 +368,7 @@ class push_helper
|
|
|
$push_param['extra']['url'] = schema_helper::bonus_detail($type_sn);
|
|
|
$push_param['extra']['image'] = self::admin_avatar();
|
|
|
|
|
|
- QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ self::push($user,$push_param);
|
|
|
}
|
|
|
|
|
|
private static function inviter_order_complete_text(member_info $invitee, $level, $money, $rate)
|
|
@@ -341,7 +378,7 @@ class push_helper
|
|
|
return "您的{$level}度粉丝 {$nickname} 下单成功,您获得{$text}红包奖励.";
|
|
|
}
|
|
|
|
|
|
- public static function inviter_order_complete_bonus($inviter, $user, $level, $money, $rate, $type_sn)
|
|
|
+ public static function inviter_order_complete_bonus($inviter, $user, $level, $money, $rate, $type_sn,$fQueue=false)
|
|
|
{
|
|
|
$user_info = new member_info($user);
|
|
|
$text = self::inviter_order_complete_text($user_info,$level,$money,$rate);
|
|
@@ -358,7 +395,7 @@ class push_helper
|
|
|
$push_param['extra']['url'] = schema_helper::bonus_detail($type_sn);
|
|
|
$push_param['extra']['image'] = $user_info->avatar();
|
|
|
|
|
|
- QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ self::push($inviter,$push_param,Sms::tpl_order_complete_inviter,['level' => $level,'name' => $user_info->nickname(),'amount' => $money],$fQueue);
|
|
|
}
|
|
|
|
|
|
private static function invitee_order_complete_text(member_info $user, $money, $rate)
|
|
@@ -367,7 +404,7 @@ class push_helper
|
|
|
$text = self::money_rate_desc($money, $rate);
|
|
|
return "好友{$nickname}下单成功,您获得{$text}红包奖励.";
|
|
|
}
|
|
|
- public static function invitee_order_complete_bonus($invitee,member_info $user, $money, $rate, $type_sn)
|
|
|
+ public static function invitee_order_complete_bonus($invitee,member_info $user, $money, $rate, $type_sn,$fQueue=false)
|
|
|
{
|
|
|
$text = self::invitee_order_complete_text($user,$money,$rate);
|
|
|
|
|
@@ -383,7 +420,7 @@ class push_helper
|
|
|
$push_param['extra']['url'] = schema_helper::bonus_detail($type_sn);
|
|
|
$push_param['extra']['image'] = $user->avatar();
|
|
|
|
|
|
- QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ self::push('upushSendMsg',$push_param,Sms::tpl_order_complete_invitee,['name' => $user->nickname(),'amount' => $money],$fQueue);
|
|
|
}
|
|
|
|
|
|
public static function order_cancel_bonus($member_id,$amount,$rate,$order_sn,$type_sn)
|