$customer_name, 'id_type' => 150, 'id_num' => $customer_id_card, 'wechat_user_id' => $we_user_id ); $result = $this->insert($data); if ($result) { return Util::returnJsSu('插入成功'); } else { return Util::returnJsEr('插入失败'); } } /** * Function Description:修改联系人信息 * Function Name: uptCustomer * @param $customer_name * @param $customer_id_card * @param $customer_id * * @return array * * @author 娄梦宁 */ public function uptCustomer($customer_name, $customer_id_card, $customer_id) { $data = array( 'cust_name' => $customer_name, 'id_type' => 150, 'id_num' => $customer_id_card ); $result = $this->update($data, "id=$customer_id"); if ($result['flag'] == false) { return Util::returnArrEr('更新出错'); } return $result; } /** * Function Description:获取乘客人 * Function Name: getCustomerList * @param $we_user_id * * @return string * * @author 张帅 */ public function getCustomerList($we_user_id) { $sql = '' . 'SELECT id AS customer_id, `name` AS customer_name, id_num AS customer_id_card FROM wechat_customer WHERE cancel_flag = 0 AND wechat_user_id = ' . $we_user_id . ' AND id_type = 150'; $result = $this->fetchAll($sql); if ($result !== false) { return Util::returnJsSu('', $result); } else { return Util::returnJsEr('数据库错误'); } } }