encryptPassword($NewPassword); $ret = $this->where(['id' => $uid])->update(['password' => $passwd]); return $ret; } // 密码加密 protected function encryptPassword($password, $salt = '', $encrypt = 'md5') { return $encrypt($password . $salt); } public function checkByCityCodes($city_codes = [], $admin_id = null) { if (0 === $city_codes) return false; $query = $this->where("type", \E_ADMIN_TYPE::Agency); $orSql = join(" or ", array_map(function ($data) { return "FIND_IN_SET('$data', city_codes)"; }, $city_codes)); if ($admin_id > 0) $query->where("id", "<>", $admin_id); return $query->where("( $orSql )") ->select(); } public function findAgency($city_code) { return $this->where("FIND_IN_SET('$city_code', city_codes)") ->where("type", \E_ADMIN_TYPE::Agency) ->order("createtime", "ASC") ->find(); } public function findByUnionId($union_id) { return $this->where("union_id", $union_id) ->find(); } public function findByMobile($mobile) { return $this->where("mobile", $mobile)->find(); } }