wupengfei 3 years ago
parent
commit
a965913430
2 changed files with 8 additions and 15 deletions
  1. 2 10
      application/common.php
  2. 6 5
      application/store/controller/LiveAppointment.php

+ 2 - 10
application/common.php

@@ -145,7 +145,7 @@ function send_message($access_token,$openid,$jump_url,$data=[]){
         'touser'=>$openid,
         'mp_template_msg'=>[
             "appid"=>"wx8e881917d7c4c283",// 公众号
-            "template_id"=>"2n42cwWat6UsokuOd9uqYAKIOF4Jbezw7hwVht11pz4",
+            "template_id"=>"k36NAugBdarjBkMJQgMJqdpgIXtV4S89U7LQfPc9BAM",
             "url"=>$jump_url,
             'miniprogram'=>[
                 //"appid"=>"wx4ccfaf737dd24004",// 小程序
@@ -167,16 +167,8 @@ function send_message($access_token,$openid,$jump_url,$data=[]){
                     "value"=>$data[3],
                     "color"=>"#173177"
                 ],
-                'keyword4'=>[
-                    "value"=>'李白刷野',
-                    "color"=>"#173177"
-                ],
-                'keyword5'=>[
-                    "value"=>'20:30',
-                    "color"=>"#173177"
-                ],
                 'remark'=>[
-                    "value"=>'屋里割草',
+                    "value"=>$data[4],
                     "color"=>"#173177"
                 ]
             ]

+ 6 - 5
application/store/controller/LiveAppointment.php

@@ -87,7 +87,7 @@ class LiveAppointment extends Controller
         $goods_id = input('goods_id');
         $user_app = Db::table('live_goods_app')
             ->alias('a')
-            ->field('a.id,a.user_id, m.openid')
+            ->field('a.id,a.user_id, m.openid,m.name')
             ->join('store_member m' , 'a.user_id = m.id','LEFT')
             ->where(['a.live_id'=>$live_id,'a.goods_id'=>$goods_id,'is_remind'=>0])
             ->select();
@@ -95,16 +95,17 @@ class LiveAppointment extends Controller
             echo json_encode(['code'=>201,'msg'=>'暂无需要提醒的预约!']);die();
         }
         $good_info = Db::table('live_goods_list')->find($goods_id);
+        $st_time = Db::table('store_live')->where('id',$live_id)->value('start_at');
         // 发消息
         $jump_url = Db::table('platform_set')->where(['name'=>'push_link'])->value('content');
         $access_token = get_access_token();
         foreach ($user_app as $uv) {
            $data=[
-               '你预约的商品马上就要开播了',
-               'OMG!MM预约的宝贝马上开播喽!',
+               '姐妹们,你预约的商品马上开播咯!',
+               $uv['name'],
                $good_info['name'],
-               '快来直播间抢购吧!Get超多直播福利',
-
+               $st_time,
+               '快来【樊樊直播间】抢购吧!Get超多直播福利!',
             ];
            $send_res =  send_message($access_token,$uv['openid'],$jump_url,$data);
         }