WeixinnotifyModel.class.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. <?php
  2. namespace Home\Model;
  3. use Think\Model;
  4. /**
  5. * 拼团模型模型
  6. * @author fish
  7. *
  8. */
  9. class WeixinnotifyModel {
  10. public function orderBuy($order_id,$is_admin=false)
  11. {
  12. $order_info = M('lionfish_comshop_order')->where( array('order_id' => $order_id ) )->find();
  13. $member_info = M('lionfish_comshop_member')->where( array('member_id' => $order_info['member_id'] ) )->find();
  14. $order_notify_switch = D('Home/Front')->get_config_by_name('order_notify_switch');
  15. if( isset($order_notify_switch) && $order_notify_switch == 1 )
  16. {
  17. $notify_order_list = S('notify_order_list');
  18. if( empty($notify_order_list) || count($notify_order_list) < 100 )
  19. {
  20. if(empty($notify_order_list))
  21. {
  22. $notify_order_list = array();
  23. }
  24. $miao = 1;
  25. $result_data = array();
  26. $result_data['code'] = 0;
  27. $result_data['username'] = $notify_od_data['username'];
  28. $result_data['avatar'] = $notify_od_data['avatar'];
  29. $result_data['order_id'] = $notify_od_data['order_id'];
  30. $result_data['order_url'] = '';
  31. $result_data['miao'] = $miao;
  32. $notify_order_list[] = $result_data;
  33. S('notify_order_list', $notify_order_list );
  34. }
  35. }
  36. $order = $order_info;
  37. if($order['is_pin'] == 0)
  38. {
  39. //$share_model = load_model_class('commission');
  40. //$share_model->send_order_commiss_money( $order['order_id'] );
  41. //单独购买分佣
  42. $fenxiao_model = D('Home/Commission');//D('Home/Fenxiao');
  43. $community_model = D('Seller/Community');
  44. $supply_model = D('Seller/Supply');
  45. $order_goods_list = M('lionfish_comshop_order_goods')->where( array('order_id' =>$order['order_id'] ) )->select();
  46. $order_goods_name = "";
  47. $i_count = count($order_goods_list);
  48. $shipping_money = 0;
  49. if($order['delivery'] == 'tuanz_send')
  50. {
  51. $shipping_money = $order['shipping_fare'];
  52. }
  53. $i =1;
  54. //sendMemberPointChange($member_id,$num, $changetype ,$remark ='', $uniacid = 0,$type='system_add', $order_id =0 ,$order_goods_id = 0)
  55. $open_buy_send_score = D('Home/Front')->get_config_by_name('open_buy_send_score');
  56. if( empty($open_buy_send_score) )
  57. {
  58. $open_buy_send_score = 0;
  59. }
  60. $is_take_commiss = 1;
  61. //礼品卡不参与分销时
  62. $virtualcard_result = D('Seller/VirtualCard')->getVirtualCardOrderInfO( $order['order_id'] );
  63. if( $virtualcard_result['code'] == 0 ) {
  64. $virtualcard_is_takecommiss = D('Home/Front')->get_config_by_name('virtualcard_is_takecommiss');
  65. if( !isset($virtualcard_is_takecommiss) || $virtualcard_is_takecommiss == 0)
  66. {
  67. $is_take_commiss = 0;
  68. }
  69. }
  70. //礼品卡不参与分销
  71. foreach($order_goods_list as $order_goods)
  72. {
  73. $order_goods_name .= $order_goods['name']." \r\n";
  74. if( $order_info['type'] != 'integral' && $is_take_commiss == 1 )
  75. {
  76. $fenxiao_model->ins_member_commiss_order($order['member_id'],$order['order_id'],$order_goods['store_id'],$order_goods['order_goods_id'] );
  77. //$community_model->ins_head_commiss_order($order['order_id'],$order_goods['order_goods_id'] );
  78. if($i == $i_count)
  79. {
  80. $community_model->ins_head_commiss_order($order['order_id'],$order_goods['order_goods_id'], $shipping_money);
  81. }else{
  82. $community_model->ins_head_commiss_order($order['order_id'],$order_goods['order_goods_id'], 0);
  83. }
  84. $supply_model->ins_supply_commiss_order($order['order_id'],$order_goods['order_goods_id'], 0);
  85. //改成下单新增商品今日销量
  86. //D('Seller/Commonorder')->inc_daygoods_buy( $order_goods['goods_id'], $order_goods['quantity'] );
  87. }
  88. $i++;
  89. }
  90. //下单加入缓存S中
  91. $day_time = strtotime( date('Y-m-d '.'00:00:00') );
  92. $day_key = 'new_ordernotice_'.$day_time;
  93. $day_arr = S( $day_key );
  94. if( empty($day_arr) )
  95. {
  96. $day_arr = array();
  97. $day_arr[] = $order['order_id'];
  98. }else{
  99. $day_arr[] = $order['order_id'];
  100. }
  101. S($day_key, $day_arr );
  102. if( $order_info['delivery'] == 'localtown_delivery' )
  103. {
  104. //开始启动配送D('Home/LocaltownDelivery')->change_distribution_order_state( $order['order_id'], 0, 1);
  105. $remark = '已付款,备货中';
  106. D('Home/LocaltownDelivery')->write_distribution_log( $order['order_id'], 0 , 0 ,$remark );
  107. }
  108. //发送小程序模板消息 : 订单 订单时间 商品名称 支付金额 温馨提示
  109. if( $order_info['from_type'] == 'wepro' )
  110. {
  111. $this->sendOrderbuyMsg( $order_info , $order_goods_name , $is_admin ,$member_info);
  112. }
  113. //小票打印
  114. $is_print_auto = D('Home/Front')->get_config_by_name('is_print_auto');
  115. if(empty($is_print_auto) || $is_print_auto == 0 ){
  116. D('Seller/Printaction')->check_print_order($order['order_id']);
  117. D('Seller/Printaction')->check_print_order2($order['order_id']);
  118. }
  119. //send dan msg
  120. } else {
  121. $pin_model = D('Home/Pin');
  122. $is_tuanz = $pin_model->checkOrderIsTuanzhang($order['order_id']);
  123. $pin_order = M('lionfish_comshop_pin_order')->where( array('order_id' => $order_id ) )->find();
  124. $pin_info = M('lionfish_comshop_pin')->where( array('pin_id' => $pin_id ) )->find();
  125. $order_goods = M('lionfish_comshop_order_goods')->where( array('order_id' => $order['order_id'] ) )->find();
  126. if($is_tuanz) {
  127. //开团成功
  128. //member_id
  129. $opentuantitmsg = '开团成功';
  130. $opentuandescmsg = '恭喜开团成功!马上叫小伙伴来参团,组团成功才能享受优惠哦';
  131. $shop_domain = D('Home/Front')->get_config_by_name('shop_domain');
  132. $url = $shop_domain;
  133. } else {
  134. //参团成功
  135. $tacktuantitmsg = '参团成功';
  136. $tacktuandescmsg = '恭喜参团成功!马上叫小伙伴来参团,组团成功才能享受优惠哦';
  137. $shop_domain = D('Home/Front')->get_config_by_name('shop_domain');
  138. }
  139. }
  140. }
  141. /**
  142. * @author yj
  143. * @desc 厦门狮子鱼网络科技有限公司 , 发送订单支付后的消息
  144. * @param $order_info
  145. * @param $order_goods_name
  146. * @param int $is_admin
  147. * @param $member_info
  148. */
  149. public function sendOrderbuyMsg( $order_info , $order_goods_name , $is_admin = 0, $member_info )
  150. {
  151. $shop_domain = D('Home/Front')->get_config_by_name('shop_domain');
  152. $url = $shop_domain;
  153. if( $order_info['from_type'] == 'wepro' )
  154. {
  155. $order = $order_info;
  156. $template_data = array();
  157. $template_data['keyword1'] = array('value' => $order_info['order_num_alias'], 'color' => '#030303');
  158. $template_data['keyword2'] = array('value' => date('Y-m-d H:i:s',$order_info['pay_time']), 'color' => '#030303');
  159. $template_data['keyword3'] = array('value' => $order_goods_name, 'color' => '#030303');
  160. if( $order_info['type'] == 'integral' )
  161. {
  162. $shipp_str = "";
  163. if( $order_info['shipping_fare'] > 0 )
  164. {
  165. $shipp_str = sprintf("%01.2f", $order_info['shipping_fare']);
  166. $shipp_str .= '元+';
  167. $shipp_str .= sprintf("%01.2f", $order_info['total']);
  168. $shipp_str .= '积分';
  169. }else{
  170. $shipp_str = sprintf("%01.2f", $order_info['total']);
  171. $shipp_str .= '积分';
  172. }
  173. $template_data['keyword4'] = array('value' => $shipp_str , 'color' => '#030303');
  174. }else{
  175. if($order_info['is_localtown_free_shipping_fare'] == 1){
  176. $order_info['total'] = $order_info['total']+$order_info['shipping_fare']-$order_info['voucher_credit']-$order_info['fullreduction_money'] - $order_info['fare_shipping_free']+$order_info['packing_fare'];
  177. }else{
  178. $order_info['total'] = $order_info['total']+$order_info['shipping_fare']-$order_info['voucher_credit']-$order_info['fullreduction_money'] - $order_info['fare_shipping_free'] + $order_info['localtown_free_shipping_fare']+$order_info['packing_fare'];
  179. }
  180. //15 +0 -0 -0.55 -0
  181. if($order_info['total'] <= 0)
  182. {
  183. $order_info['total'] = 0;
  184. }
  185. $template_data['keyword4'] = array('value' => sprintf("%01.2f", $order_info['total']), 'color' => '#030303');
  186. }
  187. $template_data['keyword5'] = array('value' => '你已支付成功,商家会尽快为你发货,请耐心等待哦', 'color' => '#030303');
  188. $template_id = D('Home/Front')->get_config_by_name('weprogram_template_pay_order' );
  189. if($order_info['delivery'] == 'hexiao'){
  190. $pagepath = 'lionfish_comshop/pages/order/order?id='.$order['order_id']."&delivery=hexiao";
  191. }
  192. else if( $order_info['delivery'] == 'pickup' )
  193. {
  194. $pagepath = 'lionfish_comshop/pages/order/order?id='.$order_info['order_id']."&delivery=pickup";
  195. }
  196. else
  197. {
  198. $pagepath = 'lionfish_comshop/pages/order/order?id='.$order['order_id'];
  199. }
  200. $mb_subscribe = M('lionfish_comshop_subscribe')->where( array('member_id' => $order['member_id'] , 'type' => 'pay_order') )->find();
  201. if( !empty($mb_subscribe) )
  202. {
  203. $template_id = D('Home/Front')->get_config_by_name('weprogram_subtemplate_pay_order');
  204. $order_goods_name2 = mb_substr($order_goods_name,0,20,'utf-8');
  205. $order_goods_name2 = mb_substr( $order_goods_name2,0,10,'utf-8');
  206. $template_data = array();
  207. $template_data['character_string1'] = array('value' => $order_info['order_num_alias'] );
  208. $template_data['date2'] = array('value' => date('Y-m-d H:i:s') );
  209. $template_data['thing3'] = array('value' => $order_goods_name2 );
  210. $template_data['amount4'] = array('value' => sprintf("%01.2f", $order_info['total']) );
  211. $template_data['thing7'] = array('value' => '商家会尽快为你发货,请耐心等待哦' );
  212. if( $order_info['order_status_id'] == 15 )
  213. {
  214. //预售第一次付款
  215. $template_data['thing7'] = array('value' => '预售订单下单成功,待支付尾款!' );
  216. }
  217. D('Seller/User')->send_subscript_msg( $template_data,$url,$pagepath,$member_info['we_openid'],$template_id );
  218. M('lionfish_comshop_subscribe')->where( array('id' => $mb_subscribe['id'] ) )->delete();
  219. }
  220. $wx_template_data = array();
  221. $weixin_appid = D('Home/Front')->get_config_by_name('weixin_appid');
  222. $weixin_template_pay_order = D('Home/Front')->get_config_by_name('weixin_template_pay_order');
  223. if( !empty($weixin_appid) && !empty($weixin_template_pay_order) )
  224. {
  225. $remark = '商家会尽快为你发货,请耐心等待哦';
  226. if( $order_info['order_status_id'] == 15 )
  227. {
  228. //预售第一次付款
  229. $remark = '预售订单下单成功,待支付尾款!';
  230. }
  231. $wx_template_data = array(
  232. 'appid' => $weixin_appid,
  233. 'template_id' => $weixin_template_pay_order,
  234. 'pagepath' => $pagepath,
  235. 'data' => array(
  236. 'first' => array('value' => '你已支付成功.>>查看订单详情','color' => '#030303'),
  237. 'keyword1' => array('value' => $member_info['username'],'color' => '#030303'),
  238. 'keyword2' => array('value' => $order_info['order_num_alias'],'color' => '#030303'),
  239. 'keyword3' => array('value' => sprintf("%01.2f", $order_info['total']),'color' => '#030303'),
  240. 'keyword4' => array('value' => $order_goods_name,'color' => '#030303'),
  241. 'remark' => array('value' => $remark ,'color' => '#030303'),
  242. )
  243. );
  244. }
  245. $delay_time = 0;
  246. if( !$is_admin )
  247. {
  248. $delay_time = 1;
  249. }
  250. D('Seller/User')->send_wxtemplate_msg($template_data,$url,$pagepath,$member_info['we_openid'],$template_id,'',0,$wx_template_data,$delay_time);
  251. //会员下单成功发送公众号提醒给会员
  252. /*
  253. $rember_send_info =array();
  254. $weixin_appid = D('Home/Front')->get_config_by_name('weixin_appid');
  255. $weixin_template_order_buy = D('Home/Front')->get_config_by_name('weixin_template_order_buy');
  256. if( !empty($weixin_appid) && !empty($weixin_template_order_buy) )
  257. {
  258. $head_pathinfo = "lionfish_comshop/moduleA/groupCenter/groupDetail?groupOrderId=".$order['order_id'];
  259. $first = $member_info['username'].'您好,您已支付成功.商家会尽快为你发货,请耐心等待哦';
  260. if( $order_info['order_status_id'] == 15 )
  261. {
  262. //预售第一次付款
  263. $first = array('value' => '您好,您已支付成功!' );
  264. }
  265. $rember_send_info = array(
  266. 'appid' => $weixin_appid,
  267. 'template_id' => $weixin_template_order_buy,
  268. 'pagepath' => $head_pathinfo,
  269. 'data' => array(
  270. 'first' => array('value' => $first ,'color' => '#030303'),
  271. 'tradeDateTime' => array('value' => date('Y-m-d H:i:s'),'color' => '#030303'),
  272. 'orderType' => array('value' => '用户购买','color' => '#030303'),
  273. 'customerInfo' => array('value' => $member_info['username'],'color' => '#030303'),
  274. 'orderItemName' => array('value' => '订单编号','color' => '#030303'),
  275. 'orderItemData' => array('value' => $order_info['order_num_alias'],'color' => '#030303'),
  276. 'remark' => array('value' => '点击查看订单详情','color' => '#030303'),
  277. )
  278. );
  279. }
  280. $weopenid = M('lionfish_comshop_member')->field('we_openid')->where( array('member_id' => $member_info['member_id'] ) )->find();
  281. $mnzember_formid_info = M('lionfish_comshop_member_formid')->where( "member_id=". $member_info['member_id']." and formid != '' and state = 1 " )->order('id desc ')->find();
  282. $template_data['keyword5'] = array('value' => '您好,'.$member_info['username'].'用户购买了一个新订单', 'color' => '#030303');
  283. $res = D('Seller/User')->send_wxtemplate_msg(array() ,$url,$head_pathinfo,$weopenid['we_openid'],$template_id,$mnzember_formid_info['formid'], 0,$rember_send_info);
  284. */
  285. //会员下单成功发送公众号提醒给团长 weixin_template_order_buy
  286. //通知开关状态 0为关,1为开
  287. $template_order_success_notice= D('Home/Front')->get_config_by_name('template_order_success_notice' );
  288. if(!empty($template_order_success_notice)){
  289. $weixin_template_order =array();
  290. $weixin_appid = D('Home/Front')->get_config_by_name('weixin_appid');
  291. $weixin_template_order_buy = D('Home/Front')->get_config_by_name('weixin_template_order_buy');
  292. if( !empty($weixin_appid) && !empty($weixin_template_order_buy))
  293. {
  294. $head_pathinfo = "lionfish_comshop/moduleA/groupCenter/groupDetail?groupOrderId=".$order['order_id'];
  295. $first = '您好团长,您收到了一个新订单,请尽快接单处理';
  296. if( $order_info['order_status_id'] == 15 )
  297. {
  298. $first = '您好,团长收到了一个新预售订单';
  299. }
  300. $weixin_template_order = array(
  301. 'appid' => $weixin_appid,
  302. 'template_id' => $weixin_template_order_buy,
  303. 'pagepath' => $head_pathinfo,
  304. 'data' => array(
  305. 'first' => array('value' => $first,'color' => '#030303'),
  306. 'tradeDateTime' => array('value' => date('Y-m-d H:i:s'),'color' => '#030303'),
  307. 'orderType' => array('value' => '用户购买','color' => '#030303'),
  308. 'customerInfo' => array('value' => $member_info['username'],'color' => '#030303'),
  309. 'orderItemName' => array('value' => '订单编号','color' => '#030303'),
  310. 'orderItemData' => array('value' => $order_info['order_num_alias'],'color' => '#030303'),
  311. 'remark' => array('value' => '点击查看订单详情','color' => '#030303'),
  312. )
  313. );
  314. }
  315. $headid = $order_info['head_id'];
  316. $head_info = M('lionfish_community_head')->field('member_id')->where( array('id' => $headid ) )->find();
  317. $weopenid = M('lionfish_comshop_member')->field('we_openid')->where( array('member_id' => $head_info['member_id'] ) )->find();
  318. $mnzember_formid_info = M('lionfish_comshop_member_formid')->where( "member_id=". $head_info['member_id']." and formid != '' and state = 1 " )->order('id desc ')->find();
  319. $template_data['keyword5'] = array('value' => '您好,团长收到了一个新订单', 'color' => '#030303');
  320. $res = D('Seller/User')->send_wxtemplate_msg(array() ,$url,$head_pathinfo,$weopenid['we_openid'],$template_id,$mnzember_formid_info['formid'], 0,$weixin_template_order);
  321. }
  322. //会员下单成功发送公众号提醒给供应商 is_order_notice_supply
  323. $is_order_notice_supply= D('Home/Front')->get_config_by_name('is_order_notice_supply' );
  324. if( !empty($is_order_notice_supply)){
  325. $supply_send_info =array();
  326. $weixin_appid = D('Home/Front')->get_config_by_name('weixin_appid' );
  327. $weixin_template_order_buy = D('Home/Front')->get_config_by_name('weixin_template_order_buy' );
  328. if( !empty($weixin_appid) && !empty($weixin_template_order_buy) )
  329. {
  330. $head_pathinfo = "lionfish_comshop/moduleA/groupCenter/groupDetail?groupOrderId=".$order['order_id'];
  331. $first = '您好,供应商收到了一个新订单';
  332. if( $order_info['order_status_id'] == 15 )
  333. {
  334. $first = '您好,供应商收到了一个新预售订单';
  335. }
  336. $supply_send_info = array(
  337. 'appid' => $weixin_appid,
  338. 'template_id' => $weixin_template_order_buy,
  339. 'pagepath' => $head_pathinfo,
  340. 'data' => array(
  341. 'first' => array('value' => $first ,'color' => '#030303'),
  342. 'tradeDateTime' => array('value' => date('Y-m-d H:i:s'),'color' => '#030303'),
  343. 'orderType' => array('value' => '用户购买','color' => '#030303'),
  344. 'customerInfo' => array('value' => $member_info['username'],'color' => '#030303'),
  345. 'orderItemName' => array('value' => '订单编号','color' => '#030303'),
  346. 'orderItemData' => array('value' => $order_info['order_num_alias'],'color' => '#030303'),
  347. 'remark' => array('value' => '点击查看订单详情','color' => '#030303'),
  348. )
  349. );
  350. }
  351. //供应商id 订单id $order_info['order_id']
  352. $order_goods = M('lionfish_comshop_order_goods')->where( array('order_id' => $order_info['order_id'] ) )->find();
  353. if( !empty($order_goods['supply_id']) && $order_goods['supply_id'] > 0 )
  354. {
  355. //关联会员id
  356. $supply_info = M('lionfish_comshop_supply')->where( array('id' => $order_goods['supply_id'] ) )->find();
  357. $first = '您好,供应商收到了一个新订单';
  358. if( $order_info['order_status_id'] == 15 )
  359. {
  360. $first = '您好,供应商收到了一个新预售订单';
  361. }
  362. if( !empty($supply_info['member_id']) && $supply_info['member_id'] > 0 )
  363. {
  364. //会员openid
  365. $weopenid = M('lionfish_comshop_member')->where( array('member_id' => $supply_info['member_id'] ) )->find();
  366. $mnzember_formid_info = M('lionfish_comshop_member_formid')->where( "member_id=". $supply_info['member_id']." and formid != '' and state = 1 " )->order('id desc ')->find();
  367. $template_data['keyword5'] = array('value' => $first , 'color' => '#030303');
  368. $sd_result = D('Seller/User')->send_wxtemplate_msg( array() ,$url,$head_pathinfo,$weopenid['we_openid'],$template_id,$mnzember_formid_info['formid'], 0,$supply_send_info);
  369. }
  370. }
  371. }
  372. //会员下单成功发送公众号提醒给平台 platform_send_info_member
  373. $platform_send_info_member= D('Home/Front')->get_config_by_name('platform_send_info_member' );
  374. if($platform_send_info_member){
  375. $platform_send_info =array();
  376. $weixin_appid = D('Home/Front')->get_config_by_name('weixin_appid');
  377. $weixin_template_order_buy = D('Home/Front')->get_config_by_name('weixin_template_order_buy');
  378. if( !empty($weixin_appid) && !empty($weixin_template_order_buy) )
  379. {
  380. $head_pathinfo = "lionfish_comshop/moduleA/groupCenter/groupDetail?groupOrderId=".$order['order_id'];
  381. $first = '您好,平台收到了一个新订单';
  382. if( $order_info['order_status_id'] == 15 )
  383. {
  384. $first = '您好,平台收到了一个新订单';
  385. }
  386. $platform_send_info = array(
  387. 'appid' => $weixin_appid,
  388. 'template_id' => $weixin_template_order_buy,
  389. 'pagepath' => $head_pathinfo,
  390. 'data' => array(
  391. 'first' => array('value' => $first ,'color' => '#030303'),
  392. 'tradeDateTime' => array('value' => date('Y-m-d H:i:s'),'color' => '#030303'),
  393. 'orderType' => array('value' => '用户购买','color' => '#030303'),
  394. 'customerInfo' => array('value' => $member_info['username'],'color' => '#030303'),
  395. 'orderItemName' => array('value' => '订单编号','color' => '#030303'),
  396. 'orderItemData' => array('value' => $order_info['order_num_alias'],'color' => '#030303'),
  397. 'remark' => array('value' => '点击查看订单详情','color' => '#030303'),
  398. )
  399. );
  400. }
  401. $memberid = $platform_send_info_member;
  402. $result = explode(",", $memberid);
  403. foreach($result as $re){
  404. $pingtai = M('lionfish_comshop_member')->where( array('member_id' => $re ) )->find();
  405. $mnzember_formid_info = M('lionfish_comshop_member_formid')->where("member_id={$re} and formid != '' and state = 1 ")->order('id desc')->find();
  406. //测试
  407. $template_data['keyword5'] = array('value' => $first , 'color' => '#030303');
  408. $sd_result = D('Seller/User')->send_wxtemplate_msg( array() ,$url,$head_pathinfo,$pingtai['we_openid'],$template_id,$mnzember_formid_info['formid'], 0,$platform_send_info);
  409. }
  410. }
  411. if( $member_info['openid'] != '1')
  412. {
  413. //购买成功通知 weixin_template_pay_order
  414. //send_template_msg($wx_template_data,$url,$member_info['openid'],C('weixin_template_pay_order'));
  415. }
  416. }
  417. }
  418. }