You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

87 lines
2.9 KiB

  1. <?php
  2. /**
  3. * 微信推送时 调用指定方法
  4. * ============================================================================
  5. * * 版权所有 运游通 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 倪宗锋
  12. * PhpStorm WxDoFunction.php
  13. * Create By 2017/1/5 11:37 $
  14. */
  15. namespace common\config\wechatConfig;
  16. use common\models\FxUserOpenid;
  17. class WxDoFunction
  18. {
  19. /**
  20. * Des:扫一扫数处理
  21. * Name: scan
  22. * @param $content
  23. * @return bool|string
  24. * @author 倪宗锋
  25. */
  26. public function scan($content)
  27. {
  28. if (empty($content['FromUserName'])) {
  29. return false;
  30. }
  31. $from_qrcode_id = 0;
  32. if (!empty($content['EventKey'])) {
  33. $from_qrcode_id = (int)$content['EventKey'];
  34. }
  35. $openid = $content['FromUserName'];
  36. $userTab = new FxUserOpenid();
  37. if ($from_qrcode_id > 50000 && $from_qrcode_id < 100000) {//如果是分销用户则网分销用户的数据库添加数据
  38. $userTab->editFxWeChatFxUid($openid, $from_qrcode_id);
  39. }
  40. return '';
  41. }
  42. /**
  43. * Des:特殊字符串做处理
  44. * Name: updateUser
  45. * @param $openid
  46. * @return string
  47. * @author 倪宗锋
  48. */
  49. public function showOrderInfo($word)
  50. {
  51. if (is_numeric($word)) {
  52. if (strlen($word) == 6 || strlen($word) == 7) {
  53. $wx_interface = new WxInterfaceModel();
  54. $result = $wx_interface->sendOrderInfo($word);
  55. if ($result['flag']) {//有所查订单
  56. if ($result['data']['send_bus_res_id'] > 0) {//是否派车
  57. $bus_no = $result['data']['bus_no'];
  58. $driver_name = $result['data']['driver_name'];
  59. $driver_mobile = $result['data']['driver_mobile'];
  60. $msgSend = "车牌号:{$bus_no} 司机姓名:{$driver_name} 司机手机:{$driver_mobile}";
  61. $msgSend .= "司机到站会主动联系未到的乘客,不会遗漏客人;请不要随意拨打司机电话,否则会影响司机休息和行车安全。";
  62. } else {
  63. $msgSend = '您乘坐的车辆暂未派车,请在发车前一个小时回复订单号获取信息';
  64. }
  65. } else {
  66. $msgSend = '';
  67. }
  68. } else {
  69. $msgSend = '';
  70. }
  71. } else {
  72. $msgSend = '';
  73. }
  74. return $msgSend;
  75. }
  76. }