WeixinnotifyModel.class.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  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. /**
  14. 将prepay_id 插入formid表
  15. 3次
  16. **/
  17. if(!empty($order_info['perpay_id']) && !$is_admin)
  18. {
  19. for($i=0;$i<3;$i++)
  20. {
  21. $member_formid_data = array();
  22. $member_formid_data['member_id'] = $order_info['member_id'];
  23. $member_formid_data['state'] = 0;
  24. $member_formid_data['formid'] = $order_info['perpay_id'];
  25. $member_formid_data['addtime'] = time();
  26. M('lionfish_comshop_member_formid')->add( $member_formid_data );
  27. }
  28. }
  29. $member_info = M('lionfish_comshop_member')->where( array('member_id' => $order_info['member_id'] ) )->find();
  30. $notify_od_data = array();
  31. $notify_od_data['username'] = $member_info['username'];
  32. $notify_od_data['member_id'] = $member_info['member_id'];
  33. $notify_od_data['avatar'] = $member_info['avatar'];
  34. $notify_od_data['order_time'] = time();
  35. $notify_od_data['order_id'] = $order_id;
  36. $notify_od_data['state'] = 0;
  37. $notify_od_data['add_time'] = time();
  38. $notify_od_data['order_url'] = '';
  39. M('lionfish_comshop_notify_order')->add( $notify_od_data );
  40. $order = $order_info;
  41. if($order['is_pin'] == 0)
  42. {
  43. //$share_model = load_model_class('commission');
  44. //$share_model->send_order_commiss_money( $order['order_id'] );
  45. //单独购买分佣
  46. $fenxiao_model = D('Home/Commission');//D('Home/Fenxiao');
  47. $community_model = D('Seller/Community');
  48. $supply_model = D('Seller/Supply');
  49. $order_goods_list = M('lionfish_comshop_order_goods')->where( array('order_id' =>$order['order_id'] ) )->select();
  50. $order_goods_name = "";
  51. $i_count = count($order_goods_list);
  52. $shipping_money = 0;
  53. if($order['delivery'] == 'tuanz_send')
  54. {
  55. $shipping_money = $order['shipping_fare'];
  56. }
  57. $i =1;
  58. $i =1;
  59. //sendMemberPointChange($member_id,$num, $changetype ,$remark ='', $uniacid = 0,$type='system_add', $order_id =0 ,$order_goods_id = 0)
  60. $open_buy_send_score = D('Home/Front')->get_config_by_name('open_buy_send_score');
  61. if( empty($open_buy_send_score) )
  62. {
  63. $open_buy_send_score = 0;
  64. }
  65. foreach($order_goods_list as $order_goods)
  66. {
  67. $order_goods_name .= $order_goods['name']." \r\n";
  68. if( $order_info['type'] != 'integral' )
  69. {
  70. $fenxiao_model->ins_member_commiss_order($order['member_id'],$order['order_id'],$order_goods['store_id'],$order_goods['order_goods_id'] );
  71. //$community_model->ins_head_commiss_order($order['order_id'],$order_goods['order_goods_id'] );
  72. if($i == $i_count)
  73. {
  74. $community_model->ins_head_commiss_order($order['order_id'],$order_goods['order_goods_id'], $shipping_money);
  75. }else{
  76. $community_model->ins_head_commiss_order($order['order_id'],$order_goods['order_goods_id'], 0);
  77. }
  78. $supply_model->ins_supply_commiss_order($order['order_id'],$order_goods['order_goods_id'], 0);
  79. }
  80. $i++;
  81. }
  82. //下单加入缓存S中
  83. $day_time = strtotime( date('Y-m-d '.'00:00:00') );
  84. $day_key = 'new_ordernotice_'.$day_time;
  85. $day_arr = S( $day_key );
  86. if( empty($day_arr) )
  87. {
  88. $day_arr = array();
  89. $day_arr[] = $order['order_id'];
  90. }else{
  91. $day_arr[] = $order['order_id'];
  92. }
  93. S($day_key, $day_arr );
  94. $opentuantitmsg = '购买成功';
  95. $opentuandescmsg = '订单号:'.$order['order_num_alias'].',于'.date('Y-m-d H:i:s');
  96. //$url = $this->getSiteUrl()."/index.php?s=/order/info/id/{$order[order_id]}";
  97. $shop_domain = D('Home/Front')->get_config_by_name('shop_domain');
  98. $url = $shop_domain;
  99. $wx_template_data = array();
  100. $wx_template_data['first'] = array('value' => '购买成功', 'color' => '#030303');
  101. $wx_template_data['orderMoneySum'] = array('value' => $order_info['total'], 'color' => '#030303');
  102. $wx_template_data['orderProductName'] = array('value' => $order_goods_name, 'color' => '#030303');
  103. $wx_template_data['Remark'] = array('value' => $opentuandescmsg, 'color' => '#030303');
  104. if($order_info['delivery'] == 'pickup' && $order_info['type'] != 'lottery')
  105. { //如果订单是抽奖类型,那么久暂时不修改订单的发货状态 暂时屏蔽
  106. //M('order')->where( array('order_id' => $order['order_id']) )->save( array('order_status_id' => 4) );
  107. //$this->sendPickupMsg($order['order_id']);
  108. }
  109. //发送小程序模板消息 : 订单 订单时间 商品名称 支付金额 温馨提示
  110. if( $order_info['from_type'] == 'wepro' )
  111. {
  112. $template_data = array();
  113. $template_data['keyword1'] = array('value' => $order_info['order_num_alias'], 'color' => '#030303');
  114. $template_data['keyword2'] = array('value' => date('Y-m-d H:i:s',$order_info['pay_time']), 'color' => '#030303');
  115. $template_data['keyword3'] = array('value' => $order_goods_name, 'color' => '#030303');
  116. if( $order_info['type'] == 'integral' )
  117. {
  118. $shipp_str = "";
  119. if( $order_info['shipping_fare'] > 0 )
  120. {
  121. $shipp_str = sprintf("%01.2f", $order_info['shipping_fare']);
  122. $shipp_str .= '元+';
  123. $shipp_str .= sprintf("%01.2f", $order_info['total']);
  124. $shipp_str .= '积分';
  125. }else{
  126. $shipp_str = sprintf("%01.2f", $order_info['total']);
  127. $shipp_str .= '积分';
  128. }
  129. $template_data['keyword4'] = array('value' => $shipp_str , 'color' => '#030303');
  130. }else{
  131. $order_info['total'] = $order_info['total']+$order_info['shipping_fare']-$order_info['voucher_credit']-$order_info['fullreduction_money'];
  132. if($order_info['total'] <= 0)
  133. {
  134. $order_info['total'] = 0;
  135. }
  136. $template_data['keyword4'] = array('value' => sprintf("%01.2f", $order_info['total']), 'color' => '#030303');
  137. }
  138. $template_data['keyword5'] = array('value' => '你已支付成功,商家会尽快为你发货,请耐心等待哦', 'color' => '#030303');
  139. $template_id = D('Home/Front')->get_config_by_name('weprogram_template_pay_order' );
  140. $pagepath = 'lionfish_comshop/pages/order/order?id='.$order['order_id'];
  141. $mb_subscribe = M('lionfish_comshop_subscribe')->where( array('member_id' => $order['member_id'] , 'type' => 'pay_order') )->find();
  142. //...todo
  143. if( !empty($mb_subscribe) )
  144. {
  145. $template_id = D('Home/Front')->get_config_by_name('weprogram_subtemplate_pay_order');
  146. $order_goods_name2 = mb_substr($order_goods_name,0,20,'utf-8');
  147. $order_goods_name2 = mb_substr( $order_goods_name2,0,10,'utf-8');
  148. $template_data = array();
  149. $template_data['character_string1'] = array('value' => $order_info['order_num_alias'] );
  150. $template_data['date2'] = array('value' => date('Y-m-d H:i:s') );
  151. $template_data['thing3'] = array('value' => $order_goods_name2 );
  152. $template_data['amount4'] = array('value' => sprintf("%01.2f", $order_info['total']) );
  153. $template_data['thing7'] = array('value' => '商家会尽快为你发货,请耐心等待哦' );
  154. D('Seller/User')->send_subscript_msg( $template_data,$url,$pagepath,$member_info['we_openid'],$template_id );
  155. M('lionfish_comshop_subscribe')->where( array('id' => $mb_subscribe['id'] ) )->delete();
  156. }
  157. $wx_template_data = array();
  158. $weixin_appid = D('Home/Front')->get_config_by_name('weixin_appid');
  159. $weixin_template_pay_order = D('Home/Front')->get_config_by_name('weixin_template_pay_order');
  160. if( !empty($weixin_appid) && !empty($weixin_template_pay_order) )
  161. {
  162. $wx_template_data = array(
  163. 'appid' => $weixin_appid,
  164. 'template_id' => $weixin_template_pay_order,
  165. 'pagepath' => $pagepath,
  166. 'data' => array(
  167. 'first' => array('value' => '你已支付成功.>>查看订单详情','color' => '#030303'),
  168. 'keyword1' => array('value' => $member_info['username'],'color' => '#030303'),
  169. 'keyword2' => array('value' => $order_info['order_num_alias'],'color' => '#030303'),
  170. 'keyword3' => array('value' => sprintf("%01.2f", $order_info['total']),'color' => '#030303'),
  171. 'keyword4' => array('value' => $order_goods_name,'color' => '#030303'),
  172. 'remark' => array('value' => '商家会尽快为你发货,请耐心等待哦','color' => '#030303'),
  173. )
  174. );
  175. }
  176. $delay_time = 0;
  177. if( !$is_admin )
  178. {
  179. $delay_time = 1;
  180. }
  181. D('Seller/User')->send_wxtemplate_msg($template_data,$url,$pagepath,$member_info['we_openid'],$template_id,$member_formid_info['formid'],0,$wx_template_data,$delay_time);
  182. //会员下单成功发送公众号提醒给团长 weixin_template_order_buy
  183. //通知开关状态 0为关,1为开
  184. $template_order_success_notice= D('Home/Front')->get_config_by_name('template_order_success_notice' );
  185. if(!empty($template_order_success_notice)){
  186. $weixin_template_order =array();
  187. $weixin_appid = D('Home/Front')->get_config_by_name('weixin_appid');
  188. $weixin_template_order_buy = D('Home/Front')->get_config_by_name('weixin_template_order_buy');
  189. if( !empty($weixin_appid) && !empty($weixin_template_order_buy) )
  190. {
  191. $head_pathinfo = "lionfish_comshop/pages/groupCenter/groupDetail?groupOrderId=".$order['order_id'];
  192. $weixin_template_order = array(
  193. 'appid' => $weixin_appid,
  194. 'template_id' => $weixin_template_order_buy,
  195. 'pagepath' => $head_pathinfo,
  196. 'data' => array(
  197. 'first' => array('value' => '您好团长,您收到了一个新订单,请尽快接单处理','color' => '#030303'),
  198. 'tradeDateTime' => array('value' => date('Y-m-d H:i:s'),'color' => '#030303'),
  199. 'orderType' => array('value' => '用户购买','color' => '#030303'),
  200. 'customerInfo' => array('value' => $member_info['username'],'color' => '#030303'),
  201. 'orderItemName' => array('value' => '订单编号','color' => '#030303'),
  202. 'orderItemData' => array('value' => $order_info['order_num_alias'],'color' => '#030303'),
  203. 'remark' => array('value' => '点击查看订单详情','color' => '#030303'),
  204. )
  205. );
  206. }
  207. $headid = $order_info['head_id'];
  208. $head_info = M('lionfish_community_head')->field('member_id')->where( array('id' => $headid ) )->find();
  209. $weopenid = M('lionfish_comshop_member')->field('we_openid')->where( array('member_id' => $head_info['member_id'] ) )->find();
  210. $mnzember_formid_info = M('lionfish_comshop_member_formid')->where( "member_id=". $head_info['member_id']." and formid != '' and state = 1 " )->order('id desc ')->find();
  211. $template_data['keyword5'] = array('value' => '您好,团长收到了一个新订单', 'color' => '#030303');
  212. $res = D('Seller/User')->send_wxtemplate_msg(array() ,$url,$head_pathinfo,$weopenid['we_openid'],$template_id,$mnzember_formid_info['formid'], 0,$weixin_template_order);
  213. }
  214. //会员下单成功发送公众号提醒给供应商 is_order_notice_supply
  215. $is_order_notice_supply= D('Home/Front')->get_config_by_name('is_order_notice_supply' );
  216. if( !empty($is_order_notice_supply)){
  217. $supply_send_info =array();
  218. $weixin_appid = D('Home/Front')->get_config_by_name('weixin_appid' );
  219. $weixin_template_order_buy = D('Home/Front')->get_config_by_name('weixin_template_order_buy' );
  220. if( !empty($weixin_appid) && !empty($weixin_template_order_buy) )
  221. {
  222. $head_pathinfo = "lionfish_comshop/pages/groupCenter/groupDetail?groupOrderId=".$order['order_id'];
  223. $supply_send_info = array(
  224. 'appid' => $weixin_appid,
  225. 'template_id' => $weixin_template_order_buy,
  226. 'pagepath' => $head_pathinfo,
  227. 'data' => array(
  228. 'first' => array('value' => '您好,供应商收到了一个新订单','color' => '#030303'),
  229. 'tradeDateTime' => array('value' => date('Y-m-d H:i:s'),'color' => '#030303'),
  230. 'orderType' => array('value' => '用户购买','color' => '#030303'),
  231. 'customerInfo' => array('value' => $member_info['username'],'color' => '#030303'),
  232. 'orderItemName' => array('value' => '订单编号','color' => '#030303'),
  233. 'orderItemData' => array('value' => $order_info['order_num_alias'],'color' => '#030303'),
  234. 'remark' => array('value' => '点击查看订单详情','color' => '#030303'),
  235. )
  236. );
  237. }
  238. //供应商id 订单id $order_info['order_id']
  239. $order_goods = M('lionfish_comshop_order_goods')->where( array('order_id' => $order_info['order_id'] ) )->find();
  240. if( !empty($order_goods['supply_id']) && $order_goods['supply_id'] > 0 )
  241. {
  242. //关联会员id
  243. $supply_info = M('lionfish_comshop_supply')->where( array('id' => $order_goods['supply_id'] ) )->find();
  244. if( !empty($supply_info['member_id']) && $supply_info['member_id'] > 0 )
  245. {
  246. //会员openid
  247. $weopenid = M('lionfish_comshop_member')->where( array('member_id' => $supply_info['member_id'] ) )->find();
  248. $mnzember_formid_info = M('lionfish_comshop_member_formid')->where( "member_id=". $supply_info['member_id']." and formid != '' and state = 1 " )->order('id desc ')->find();
  249. $template_data['keyword5'] = array('value' => '您好,供应商收到了一个新订单', 'color' => '#030303');
  250. $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);
  251. }
  252. }
  253. }
  254. //会员下单成功发送公众号提醒给平台 platform_send_info_member
  255. $platform_send_info_member= D('Home/Front')->get_config_by_name('platform_send_info_member' );
  256. if($platform_send_info_member){
  257. $platform_send_info =array();
  258. $weixin_appid = D('Home/Front')->get_config_by_name('weixin_appid');
  259. $weixin_template_order_buy = D('Home/Front')->get_config_by_name('weixin_template_order_buy');
  260. if( !empty($weixin_appid) && !empty($weixin_template_order_buy) )
  261. {
  262. $head_pathinfo = "lionfish_comshop/pages/groupCenter/groupDetail?groupOrderId=".$order['order_id'];
  263. $platform_send_info = array(
  264. 'appid' => $weixin_appid,
  265. 'template_id' => $weixin_template_order_buy,
  266. 'pagepath' => $head_pathinfo,
  267. 'data' => array(
  268. 'first' => array('value' => '您好,平台收到了一个新订单','color' => '#030303'),
  269. 'tradeDateTime' => array('value' => date('Y-m-d H:i:s'),'color' => '#030303'),
  270. 'orderType' => array('value' => '用户购买','color' => '#030303'),
  271. 'customerInfo' => array('value' => $member_info['username'],'color' => '#030303'),
  272. 'orderItemName' => array('value' => '订单编号','color' => '#030303'),
  273. 'orderItemData' => array('value' => $order_info['order_num_alias'],'color' => '#030303'),
  274. 'remark' => array('value' => '点击查看订单详情','color' => '#030303'),
  275. )
  276. );
  277. }
  278. $memberid = $platform_send_info_member;
  279. $result = explode(",", $memberid);
  280. foreach($result as $re){
  281. $pingtai = M('lionfish_comshop_member')->where( array('member_id' => $re ) )->find();
  282. $mnzember_formid_info = M('lionfish_comshop_member_formid')->where("member_id={$re} and formid != '' and state = 1 ")->order('id desc')->find();
  283. //测试
  284. $template_data['keyword5'] = array('value' => '您好,平台收到了一个新订单', 'color' => '#030303');
  285. $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);
  286. }
  287. }
  288. if( $member_info['openid'] != '1')
  289. {
  290. //购买成功通知 weixin_template_pay_order
  291. //send_template_msg($wx_template_data,$url,$member_info['openid'],C('weixin_template_pay_order'));
  292. }
  293. }else{
  294. //购买成功通知 weixin_template_pay_order
  295. //send_template_msg($wx_template_data,$url,$member_info['openid'],C('weixin_template_pay_order'));
  296. }
  297. //小票打印
  298. D('Seller/Printaction')->check_print_order($order['order_id']);
  299. //send dan msg
  300. } else {
  301. $pin_model = D('Home/Pin');
  302. $is_tuanz = $pin_model->checkOrderIsTuanzhang($order['order_id']);
  303. $pin_order = M('lionfish_comshop_pin_order')->where( array('order_id' => $order_id ) )->find();
  304. $pin_info = M('lionfish_comshop_pin')->where( array('pin_id' => $pin_id ) )->find();
  305. $order_goods = M('lionfish_comshop_order_goods')->where( array('order_id' => $order['order_id'] ) )->find();
  306. if($is_tuanz) {
  307. //开团成功
  308. //member_id
  309. $opentuantitmsg = '开团成功';
  310. $opentuandescmsg = '恭喜开团成功!马上叫小伙伴来参团,组团成功才能享受优惠哦';
  311. $shop_domain = D('Home/Front')->get_config_by_name('shop_domain');
  312. $url = $shop_domain;
  313. $wx_template_data = array();
  314. $wx_template_data['keyword1'] = array('value' => $order_goods['name'], 'color' => '#030303');
  315. $wx_template_data['keyword2'] = array('value' => $order_goods['price'], 'color' => '#030303');
  316. $wx_template_data['keyword3'] = array('value' => $pin_info['need_count'], 'color' => '#030303');
  317. $wx_template_data['keyword4'] = array('value' => date('Y-m-d H:i:s', $pin_info['begin_time']), 'color' => '#030303');
  318. $wx_template_data['remark'] = array('value' => '恭喜开团成功!马上叫小伙伴来参团,组团成功才能享受优惠哦', 'color' => '#030303');
  319. if( $order_info['from_type'] == 'wepro' )
  320. {
  321. $template_data = array();
  322. $template_data['keyword1'] = array('value' => $order_info['order_num_alias'], 'color' => '#030303');
  323. $template_data['keyword2'] = array('value' => $order_goods['name'], 'color' => '#030303');
  324. $template_data['keyword3'] = array('value' => $pin_info['need_count'], 'color' => '#030303');
  325. $template_data['keyword4'] = array('value' => $order_goods['price'], 'color' => '#030303');
  326. $template_data['keyword5'] = array('value' => date('Y-m-d H:i:s', $pin_info['begin_time']), 'color' => '#030303');
  327. $template_data['keyword6'] = array('value' => date('Y-m-d H:i:s', $pin_info['end_time']), 'color' => '#030303');
  328. $template_data['keyword7'] = array('value' => '恭喜开团成功!马上叫小伙伴来参团,组团成功才能享受优惠哦', 'color' => '#030303');
  329. $template_id = D('Home/Front')->get_config_by_name('weprogram_template_open_pin', $uniacid);
  330. $pagepath = 'lionfish_comshop/pages/share/index?id='.$order['order_id'];
  331. $member_formid_info = M('lionfish_comshop_member_formid')->where( "member_id=".$member_info['member_id']." and formid != ''" )->order('id desc ')->find();
  332. //更新
  333. if(!empty($member_formid_info))
  334. {
  335. $rs = D('Seller/User')->send_wxtemplate_msg($template_data,$url,$pagepath,$member_info['we_openid'],$template_id,$member_formid_info['formid'], 0 );
  336. M('lionfish_comshop_member_formid')->where( array('id' => $member_formid_info['id'] ) )->save(array('state' => 1));
  337. }
  338. if( $member_info['openid'] != '1')
  339. {
  340. //开团成功 weixin_template_open_pin
  341. //send_template_msg($wx_template_data,$url,$member_info['openid'],C('weixin_template_open_pin'));
  342. }
  343. }else{
  344. //开团成功 weixin_template_open_pin
  345. //send_template_msg($wx_template_data,$url,$member_info['openid'],C('weixin_template_open_pin'));
  346. }
  347. } else {
  348. //参团成功
  349. $tacktuantitmsg = '参团成功';
  350. $tacktuandescmsg = '恭喜参团成功!马上叫小伙伴来参团,组团成功才能享受优惠哦';
  351. $shop_domain = D('Home/Front')->get_config_by_name('shop_domain');
  352. $url = $shop_domain;
  353. $wx_template_data = array();
  354. $wx_template_data['keyword1'] = array('value' => $order_goods['name'], 'color' => '#030303');
  355. $wx_template_data['keyword2'] = array('value' => $order_goods['price'], 'color' => '#030303');
  356. $wx_template_data['keyword3'] = array('value' => date('Y-m-d H:i:s', $pin_info['end_time']), 'color' => '#030303');
  357. $wx_template_data['remark'] = array('value' => '恭喜参团成功!马上叫小伙伴来参团,组团成功才能享受优惠哦', 'color' => '#030303');
  358. if( $order_info['from_type'] == 'wepro' )
  359. {
  360. $template_data = array();
  361. $template_data['keyword1'] = array('value' => $order_goods['name'], 'color' => '#030303');
  362. $template_data['keyword2'] = array('value' => '参团成功', 'color' => '#030303');
  363. $template_data['keyword3'] = array('value' => '恭喜参团成功!马上叫小伙伴来参团,组团成功才能享受优惠哦', 'color' => '#b26f82');
  364. $template_id = D('Home/Front')->get_config_by_name('weprogram_template_take_pin');
  365. $pagepath = 'lionfish_comshop/pages/share/index?id='.$order['order_id'];
  366. $member_formid_info = M('lionfish_comshop_member_formid')->where( "member_id=".$member_info['member_id']." and formid != ''" )->order('id desc ')->find();
  367. if(!empty($member_formid_info))
  368. {
  369. $rs = D('Seller/User')->send_wxtemplate_msg($template_data,$url,$pagepath,$member_info['we_openid'],$template_id,$member_formid_info['formid'], 0);
  370. M('lionfish_comshop_member_formid')->where( array('id' => $member_formid_info['id'] ) )->save(array('state' => 1));
  371. }
  372. if( $member_info['openid'] != '1')
  373. {
  374. //send_template_msg($wx_template_data,$url,$member_info['openid'],C('weixin_template_take_pin'));
  375. }
  376. }else{
  377. //send_template_msg($wx_template_data,$url,$member_info['openid'],C('weixin_template_take_pin'));
  378. }
  379. }
  380. }
  381. }
  382. }