25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

107 satır
2.9 KiB

  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 张帅
  12. * PhpStorm WechatCustomer.php
  13. * Create By 2016/11/17 17:52 $
  14. */
  15. namespace Order\Model;
  16. use Base\Tool\DbTable;
  17. use Util\Util\Util;
  18. class WechatCustomer extends DbTable
  19. {
  20. public $db = 'CST';
  21. public $tab = 'wechat_customer';
  22. /**
  23. * Function Description:添加乘客人
  24. * Function Name: addCustomerAction
  25. * @param $customer_name
  26. * @param $customer_id_card
  27. * @param $we_user_id
  28. *
  29. * @return string
  30. *
  31. * @author 张帅
  32. */
  33. public function addCustomer($customer_name, $customer_id_card, $we_user_id)
  34. {
  35. $data = array(
  36. 'name' => $customer_name,
  37. 'id_type' => 150,
  38. 'id_num' => $customer_id_card,
  39. 'wechat_user_id' => $we_user_id
  40. );
  41. $result = $this->insert($data);
  42. if ($result) {
  43. return Util::returnJsSu('插入成功');
  44. } else {
  45. return Util::returnJsEr('插入失败');
  46. }
  47. }
  48. /**
  49. * Function Description:修改联系人信息
  50. * Function Name: uptCustomer
  51. * @param $customer_name
  52. * @param $customer_id_card
  53. * @param $customer_id
  54. *
  55. * @return array
  56. *
  57. * @author 娄梦宁
  58. */
  59. public function uptCustomer($customer_name, $customer_id_card, $customer_id)
  60. {
  61. $data = array(
  62. 'cust_name' => $customer_name,
  63. 'id_type' => 150,
  64. 'id_num' => $customer_id_card
  65. );
  66. $result = $this->update($data, "id=$customer_id");
  67. if ($result['flag'] == false) {
  68. return Util::returnArrEr('更新出错');
  69. }
  70. return $result;
  71. }
  72. /**
  73. * Function Description:获取乘客人
  74. * Function Name: getCustomerList
  75. * @param $we_user_id
  76. *
  77. * @return string
  78. *
  79. * @author 张帅
  80. */
  81. public function getCustomerList($we_user_id)
  82. {
  83. $sql = '' . 'SELECT
  84. id AS customer_id,
  85. `name` AS customer_name,
  86. id_num AS customer_id_card
  87. FROM
  88. wechat_customer
  89. WHERE
  90. cancel_flag = 0
  91. AND wechat_user_id = ' . $we_user_id . '
  92. AND id_type = 150';
  93. $result = $this->fetchAll($sql);
  94. if ($result !== false) {
  95. return Util::returnJsSu('', $result);
  96. } else {
  97. return Util::returnJsEr('数据库错误');
  98. }
  99. }
  100. }