|
@@ -8,6 +8,19 @@
|
|
|
|
|
|
class push_helper
|
|
|
{
|
|
|
+ static $admin_info = null;
|
|
|
+
|
|
|
+ private static function admin_alias() {
|
|
|
+ return bonus\parameters::admin_member_id;
|
|
|
+ }
|
|
|
+ private static function admin_avatar()
|
|
|
+ {
|
|
|
+ if(self::$admin_info == null) {
|
|
|
+ self::$admin_info = new member_info(self::admin_alias());
|
|
|
+ }
|
|
|
+ return self::$admin_info->avatar();
|
|
|
+ }
|
|
|
+
|
|
|
public static function stolen_bonus(member_info $from_info,member_info $to_info,$amount)
|
|
|
{
|
|
|
$thief = $to_info->nickname();
|
|
@@ -148,45 +161,6 @@ class push_helper
|
|
|
QueueClient::push('upushSendMsg',$push_param);
|
|
|
}
|
|
|
|
|
|
- public static function paysuccess($member_id)
|
|
|
- {
|
|
|
- $minfo = new member_info($member_id);
|
|
|
- $text = "已收到你的货款,请留意发货短信,确认收货后会有红包奖励~";
|
|
|
-
|
|
|
- $push_param['alias'] = $member_id;
|
|
|
- $push_param['title'] = "收到购物款";
|
|
|
- $push_param['text'] = $text;
|
|
|
-
|
|
|
- $push_param['extra']['go_type'] = '';
|
|
|
- $push_param['extra']['title'] = "收到购物款";
|
|
|
- $push_param['extra']['text'] = $text;
|
|
|
- $push_param['extra']['show_type'] = 'pop';
|
|
|
- $push_param['extra']['url'] = 'xmmz://p.lrlz.com/mine/order/index?index=1';
|
|
|
- $push_param['extra']['image'] = $minfo->avatar();
|
|
|
-
|
|
|
- QueueClient::push('upushSendMsg',$push_param);
|
|
|
- }
|
|
|
-
|
|
|
- public static function paysuccess_bonus($member_id,$money)
|
|
|
- {
|
|
|
- $text = "感谢您的支持,熊猫美妆向您派发了{$money}元的购物红包,请查收~.";
|
|
|
- $minfo = new member_info($member_id);
|
|
|
-
|
|
|
- $push_param['alias'] = $member_id;
|
|
|
- $push_param['title'] = "购物奖励";
|
|
|
- $push_param['text'] = $text;
|
|
|
- $push_param['img'] = $minfo->avatar();;
|
|
|
-
|
|
|
- $push_param['extra']['go_type'] = 'bonus';
|
|
|
- $push_param['extra']['title'] = "购物奖励";
|
|
|
- $push_param['extra']['text'] = $text;
|
|
|
- $push_param['extra']['show_type']= 'pop';
|
|
|
- $push_param['extra']['url'] = 'xmmz://p.lrlz.com/main/index?index=2';
|
|
|
- $push_param['extra']['image'] = $minfo->avatar();
|
|
|
-
|
|
|
- QueueClient::push('upushSendMsg',$push_param);
|
|
|
- }
|
|
|
-
|
|
|
public static function evaluation_bonus($member_id,$money)
|
|
|
{
|
|
|
$text = "感谢您的评价,熊猫美妆送给您{$money}元红包,请查收~.";
|
|
@@ -248,6 +222,12 @@ class push_helper
|
|
|
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 money_rate_desc($money,$rate)
|
|
|
+ {
|
|
|
$discount = 100 - $rate;
|
|
|
if($discount == 0) {
|
|
|
$desc = "现金";
|
|
@@ -255,8 +235,8 @@ class push_helper
|
|
|
$tmp = $discount / 10;
|
|
|
$desc = "{$tmp}折";
|
|
|
}
|
|
|
- $text = "恭喜{$nickname}成为您的{$level}度粉丝,您获得{$money}元{$desc}红包奖励.";
|
|
|
- return $text;
|
|
|
+ $amount = intval($money * 100 + 0.5) / 100;
|
|
|
+ return "{$amount}元{$desc}";
|
|
|
}
|
|
|
|
|
|
public static function inviter_bonus($inviter, $invitee, $level, $money, $rate, $type_sn)
|
|
@@ -314,6 +294,168 @@ class push_helper
|
|
|
|
|
|
QueueClient::push('upushSendMsg',$push_param);
|
|
|
}
|
|
|
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
+ private static function buygoods_inviter_text(member_info $user, $level, $goods_name)
|
|
|
+ {
|
|
|
+ $text = "您的{$level}度粉丝 {$user->nickname()},刚刚购买了《{$goods_name}》.";
|
|
|
+ return $text;
|
|
|
+ }
|
|
|
+ public static function inviter_order_paied($inviter, $user, $level, $goods_info)
|
|
|
+ {
|
|
|
+ $user_info = new member_info($user);
|
|
|
+ $text = self::buygoods_inviter_text($user_info,$level,$goods_info['goods_name']);
|
|
|
+
|
|
|
+ $push_param['alias'] = $inviter;
|
|
|
+ $push_param['title'] = "粉丝正在买";
|
|
|
+ $push_param['text'] = $text;
|
|
|
+
|
|
|
+ $push_param['extra']['go_type'] = 'bonus';
|
|
|
+ $push_param['extra']['title'] = "粉丝正在买";
|
|
|
+ $push_param['extra']['text'] = $text;
|
|
|
+ $push_param['extra']['show_type']= 'pop';
|
|
|
+
|
|
|
+ $push_param['extra']['url'] = schema_helper::goods($goods_info['goods_id']);
|
|
|
+ $push_param['extra']['image'] = $goods_info['goods_image'];
|
|
|
+
|
|
|
+ QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static function buygoods_invitee_text(member_info $user, $goods_name)
|
|
|
+ {
|
|
|
+ $text = "您的朋友 {$user->nickname()},刚刚购买了《{$goods_name}》.";
|
|
|
+ return $text;
|
|
|
+ }
|
|
|
+ public static function invitee_order_paied($invitee, $user, $goods_info)
|
|
|
+ {
|
|
|
+ $user_info = new member_info($user);
|
|
|
+ $text = self::buygoods_invitee_text($user_info,$goods_info['goods_name']);
|
|
|
+
|
|
|
+ $push_param['alias'] = $invitee;
|
|
|
+ $push_param['title'] = "朋友正在买";
|
|
|
+ $push_param['text'] = $text;
|
|
|
+
|
|
|
+ $push_param['extra']['go_type'] = 'bonus';
|
|
|
+ $push_param['extra']['title'] = "朋友正在买";
|
|
|
+ $push_param['extra']['text'] = $text;
|
|
|
+ $push_param['extra']['show_type']= 'pop';
|
|
|
+
|
|
|
+ $push_param['extra']['url'] = schema_helper::goods($goods_info['goods_id']);
|
|
|
+ $push_param['extra']['image'] = $goods_info['goods_image'];
|
|
|
+
|
|
|
+ QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function user_order_paied($user, $paysn)
|
|
|
+ {
|
|
|
+ $text = "请留意发货短信,确认收货后会有红包奖励~";
|
|
|
+
|
|
|
+ $push_param['alias'] = $user;
|
|
|
+ $push_param['title'] = "收到购物款";
|
|
|
+ $push_param['text'] = $text;
|
|
|
+
|
|
|
+ $push_param['extra']['go_type'] = '';
|
|
|
+ $push_param['extra']['title'] = "收到购物款";
|
|
|
+ $push_param['extra']['text'] = $text;
|
|
|
+ $push_param['extra']['show_type'] = 'pop';
|
|
|
+ $push_param['extra']['url'] = schema_helper::order_info($paysn);
|
|
|
+ $push_param['extra']['image'] = self::admin_avatar();
|
|
|
+
|
|
|
+ QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ }
|
|
|
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
+ public static function user_order_complete_fixed($user, $money, $rate, $type_sn)
|
|
|
+ {
|
|
|
+ $desc = self::money_rate_desc($money,$rate);
|
|
|
+ $text = "感谢您的惠顾,熊猫美妆向您派发了{$desc}红包,请查收~.";
|
|
|
+
|
|
|
+ $push_param['alias'] = $user;
|
|
|
+ $push_param['title'] = "购物奖励";
|
|
|
+ $push_param['text'] = $text;
|
|
|
+ $push_param['img'] = self::admin_avatar();
|
|
|
+
|
|
|
+ $push_param['extra']['go_type'] = 'bonus';
|
|
|
+ $push_param['extra']['title'] = "购物奖励";
|
|
|
+ $push_param['extra']['text'] = $text;
|
|
|
+ $push_param['extra']['show_type']= 'pop';
|
|
|
+ $push_param['extra']['url'] = schema_helper::bonus_detail($type_sn);
|
|
|
+ $push_param['extra']['image'] = self::admin_avatar();
|
|
|
+
|
|
|
+ QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function user_order_complete_random($user,$num,$type_sn)
|
|
|
+ {
|
|
|
+ $text = "感谢您的惠顾,熊猫美妆向您派发了{$num}份可分享红包,点击领取一份~.";
|
|
|
+
|
|
|
+ $push_param['alias'] = $user;
|
|
|
+ $push_param['title'] = "购物分享";
|
|
|
+ $push_param['text'] = $text;
|
|
|
+ $push_param['img'] = self::admin_avatar();
|
|
|
+
|
|
|
+ $push_param['extra']['go_type'] = 'bonus';
|
|
|
+ $push_param['extra']['title'] = "购物分享";
|
|
|
+ $push_param['extra']['text'] = $text;
|
|
|
+ $push_param['extra']['show_type']= 'pop';
|
|
|
+ $push_param['extra']['url'] = schema_helper::bonus_detail($type_sn);
|
|
|
+ $push_param['extra']['image'] = self::admin_avatar();
|
|
|
+
|
|
|
+ QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static function inviter_order_complete_text(member_info $invitee, $level, $money, $rate)
|
|
|
+ {
|
|
|
+ $nickname = $invitee->nickname();
|
|
|
+ $text = self::money_rate_desc($money, $rate);
|
|
|
+ return "恭喜您的{$level}度粉丝{$nickname}购物成功,您获得{$text}红包奖励.";
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function inviter_order_complete_bonus($inviter, $invitee, $level, $money, $rate, $type_sn)
|
|
|
+ {
|
|
|
+ $invitee_info = new member_info($invitee);
|
|
|
+ $text = self::inviter_order_complete_text($invitee_info,$level,$money,$rate);
|
|
|
+
|
|
|
+ $push_param['alias'] = $inviter;
|
|
|
+ $push_param['title'] = "粉丝购物奖励";
|
|
|
+ $push_param['text'] = $text;
|
|
|
+
|
|
|
+ $push_param['extra']['go_type'] = 'bonus';
|
|
|
+ $push_param['extra']['title'] = "粉丝购物奖励";
|
|
|
+ $push_param['extra']['text'] = $text;
|
|
|
+ $push_param['extra']['show_type']= 'pop';
|
|
|
+
|
|
|
+ $push_param['extra']['url'] = schema_helper::bonus_detail($type_sn);
|
|
|
+ $push_param['extra']['image'] = $invitee_info->avatar();
|
|
|
+
|
|
|
+ QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static function invitee_order_complete_text(member_info $user, $money, $rate)
|
|
|
+ {
|
|
|
+ $nickname = $user->nickname();
|
|
|
+ $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)
|
|
|
+ {
|
|
|
+ $invitee_info = new member_info($invitee);
|
|
|
+ $text = self::invitee_order_complete_text($user,$money,$rate);
|
|
|
+
|
|
|
+ $push_param['alias'] = $invitee;
|
|
|
+ $push_param['title'] = "粉丝购物奖励";
|
|
|
+ $push_param['text'] = $text;
|
|
|
+
|
|
|
+ $push_param['extra']['go_type'] = 'bonus';
|
|
|
+ $push_param['extra']['title'] = "粉丝购物奖励";
|
|
|
+ $push_param['extra']['text'] = $text;
|
|
|
+ $push_param['extra']['show_type']= 'pop';
|
|
|
+
|
|
|
+ $push_param['extra']['url'] = schema_helper::bonus_detail($type_sn);
|
|
|
+ $push_param['extra']['image'] = $invitee_info->avatar();
|
|
|
+
|
|
|
+ QueueClient::push('upushSendMsg',$push_param);
|
|
|
+ }
|
|
|
+
|
|
|
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
public static function fcode_unlock($member_id,$num)
|
|
|
{
|