// .*?<\/script>/si";
// $str = preg_replace($search, '', $str);
// return $str;
// }
// }
// if (!function_exists('get_sex')) {
// /**
// * 获取性别
// * @return void
// * @author 刘明美 [ liumingmei@zhongbenjituan.com ]
// */
// function get_sex($sex)
// {
// $data = ['女', '男'];
// return $data[$sex];
// }
// }
// if (!function_exists('get_age')) {
// /**
// * 准备工作完毕 开始计算年龄函数
// * @param $birthday 出生时间 uninx时间戳
// * @param $time 当前时间
// * @return false|string
// */
// function get_age($birthday)
// {
// //格式化出生时间年月日
// $byear = date('Y', $birthday);
// $bmonth = date('m', $birthday);
// $bday = date('d', $birthday);
// //格式化当前时间年月日
// $tyear = date('Y');
// $tmonth = date('m');
// $tday = date('d');
// //开始计算年龄
// $age = $tyear - $byear;
// if ($bmonth > $tmonth || $bmonth == $tmonth && $bday > $tday) {
// $age--;
// }
// return $age;
// }
// }
// if (!function_exists('user_is_signin')) {
// /**
// * 判断是否登录
// * @return mixed
// * @author 刘明美 [ liumingmei@zhongbenjituan.com ]
// */
// function user_is_signin()
// {
// $user = session('mall_user_auth');
// if (empty($user)) {
// return 0;
// } else {
// return session('mall_user_auth_sign') == data_auth_sign($user) ? $user['uid'] : 0;
// }
// }
// }
// if (!function_exists('user_role_auth')) {
// /**
// * 读取当前用户权限
// * @author 刘明美 [ liumingmei@zhongbenjituan.com ]
// */
// function user_role_auth()
// {
// session('user_role_menu_auth', model('user/role')->roleAuth());
// }
// }
// if (!function_exists('filter')) {
// /**
// * Notes:数据过滤转换
// * User: EricYan
// * @param $data
// * @param null $whiteList
// * @return array
// */
// function filter($data, $whiteList = null)
// {
// $newData = array();
// if (is_string($whiteList)) {
// $whiteList = explode(',', $whiteList);
// }
// foreach ($data as $item) {
// $newData[] = filter_data($item, $whiteList);
// }
// return $newData;
// }
// }
// if (!function_exists('filter_data')) {
// /**
// * Notes:数据过滤转换
// * User: EricYan
// * @param $data
// * @param null $whiteList
// * @return array
// */
// function filter_data($data, $whiteList = null)
// {
// $newData = array();
// if (is_string($whiteList)) {
// $whiteList = explode(',', $whiteList);
// }
// if (!$whiteList) {
// foreach ($data as $key => $item) {
// switch ($key) {
// case 'cover_image':
// case 'head_img':
// $newData[$key] = get_file_url($data[$key]);
// break;
// default:
// if ($data[$key] === null) {
// $newData[$key] = '';
// } else {
// $newData[$key] = $data[$key];
// }
// }
// }
// } else {
// foreach ($whiteList as $key) {
// switch ($key) {
// case 'cover_image':
// case 'head_img':
// $newData[$key] = get_file_url($data[$key]);
// break;
// default:
// if ($data[$key] === null) {
// $newData[$key] = '';
// } else {
// $newData[$key] = $data[$key];
// }
// }
// }
// }
// return $newData;
// }
// }
// if (!function_exists('time_tran')) {
// /**
// * 转换时间
// * @param int $timer 时间戳
// * @return string
// * @author 刘明美 [ liumingmei@zhongbenjituan.com ]
// */
// function time_tran($timer)
// {
// $diff = $_SERVER['REQUEST_TIME'] - $timer;
// $day = floor($diff / 86400);
// $free = $diff % 86400;
// if ($day > 0) {
// return $day . " 天前";
// } else {
// if ($free > 0) {
// $hour = floor($free / 3600);
// $free = $free % 3600;
// if ($hour > 0) {
// return $hour . " 小时前";
// } else {
// if ($free > 0) {
// $min = floor($free / 60);
// $free = $free % 60;
// if ($min > 0) {
// return $min . " 分钟前";
// } else {
// if ($free > 0) {
// return $free . " 秒前";
// } else {
// return '刚刚';
// }
// }
// } else {
// return '刚刚';
// }
// }
// } else {
// return '刚刚';
// }
// }
// }
// }
// if (!function_exists('search_time')) {
// /**
// * @param $text
// * @param $length
// * @return string
// * author 吴秀芳
// * 2020/6/20 8:32
// * 处理时间搜索
// */
// function search_time($search_fields, $map, $model)
// {
// $wheretime = [];
// if (!empty($search_fields)) {
// foreach ($search_fields as $k => $v) {
// if ($v['type'] == 'datetime' || $v['type'] == 'between') {
// $startname = $v['name'] . '_start';
// $endname = $v['name'] . '_end';
// $start = $map[$startname];
// $end = $map[$endname];
// $min = time_min($model, $v['name']);
// $max = time_max($model, $v['name']);
// if ($v['type'] == 'datetime') {
// $start = strtotime($start);
// $end = strtotime($end);
// }
// if ($start || $end) {
// if (!$start) {
// $start = $min;
// }
// if (!$end) {
// $end = $max;
// }
// $time = [$v['name'], 'between', [$start, $end]];
// }
// unset($wheretime[$startname]);
// unset($wheretime[$endname]);
// }
// if ($v['type'] == 'text') {
// $time = [$v['prefix'] . $v['name'], 'like', '%' . $map[$v['name']] . '%'];
// }
// if ($v['type'] == 'select') {
// if ($map[$v['name']]) {
// if ($map[$v['name']] == 'all') {
// // $time = [$v['name'],'in','wxpay','alipay'];
// } else {
// if ($v['zero'] == 0) {
// $maps = $map[$v['name']] - 1;
// $time = [$v['name'], '=', $maps];
// } else {
// $time = [$v['name'], '=', $map[$v['name']]];
// }
// }
// }
// }
// array_push($wheretime, $time);
// }
// }
// return $wheretime;
// }
// }
// if (!function_exists('time2string')) {
// /**
// * @param $second
// * @return string
// * author 吴秀芳
// * 2020/7/7 12:05
// * 计算剩余时间
// */
// function time2string($second)
// {
// $day = floor($second / (3600 * 24));
// $second = $second % (3600 * 24);//除去整天之后剩余的时间
// $hour = floor($second / 3600);
// $second = $second % 3600;//除去整小时之后剩余的时间
// $minute = floor($second / 60);
// $second = $second % 60;//除去整分钟之后剩余的时间
// //返回字符串
// if (empty($day)) {
// if (empty($hour)) {
// if (empty($minute)) {
// $minute = 0;
// $data = $minute . '天';
// } else {
// $data = $minute . '分钟';
// }
// } else {
// $data = $hour . '小时';
// }
// } else {
// $data = $day . '天';
// }
// return $data;
// // return $day.'天'.$hour.'小时'.$minute.'分'.$second.'秒';
// // return $day.'天'.$hour.':'.$minute.':'.$second;
// }
// }
// if (!function_exists('check_password')) {
// /**
// * @param $second
// * @return string
// * author 吴秀芳
// * 2020/7/7 12:05
// * 检测密码
// */
// function check_password($password)
// {
// if (preg_match("/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,32}$/", $password)) {
// return true;
// } else {
// return false;
// }
// }
// }
// if (!function_exists('check_mobile')) {
// /**
// * @param $second
// * @return string
// * author 吴秀芳
// * 2020/7/7 12:05
// * 检测密码
// */
// function check_mobile($mobile)
// {
// if (!preg_match("/^1\d{10}$/", $mobile)) {
// return false;
// } else {
// return true;
// }
// }
// }
// if (!function_exists("push")) {
// /**
// * @param $nickname
// * author 吴秀芳
// * 2020/7/9 18:13
// * 极光推送
// */
// function push($accept_id, $message)
// {
// $data = addons_action('Jiguang', 'JPush', 'getClient', 'push');
// $id = Db::name('user_info')->where(['user_id' => $accept_id])->value('register_id');
// $result = $data->setPlatform('all')
// // ->addAllAudience()
// ->addRegistrationId($id)
// ->setNotificationAlert($message)
// ->send();
// if ($result['http_code'] = 200) {
// return true;
// } else {
// return false;
// }
// }
// }
// if (!function_exists("getTimeConversion")) {
// /**
// * 获取时间周期统一方法
// * @param $time 所取时间阶段标识(参数请参考方法参数值)
// * @param $timeFormat 返回时间区间的格式(ymd:年月日格式;stamp:时间戳格式)
// * @return array
// * @since 2020年11月2日16:00:21
// * @author zenghu < 1427305236@qq.com >
// */
// function getTimeConversion($time = 'day', $timeFormat = 'ymd')
// {
// // 定义返回的时间
// $returnTime = [];
// // 获取指定时间段节点
// switch ($time) {
// case 'day': // 当天
// case 'd':
// $returnTime['startTime'] = date('Y-m-d') . ' 00:00:00';
// $returnTime['endTime'] = date('Y-m-d') . ' 23:59:59';
// break;
// case 'yesterday': // 昨天
// case 'ystd':
// $returnTime['startTime'] = date("Y-m-d", strtotime("-1 day")) . ' 00:00:00';
// $returnTime['endTime'] = date("Y-m-d", strtotime("-1 day")) . ' 23:59:59';
// break;
// case 'tomorrow': // 明天
// case 'tmr':
// $returnTime['startTime'] = date("Y-m-d", strtotime("+1 day")) . ' 00:00:00';
// $returnTime['endTime'] = date("Y-m-d", strtotime("+1 day")) . ' 23:59:59';
// break;
// case 'week': // 本周
// case 'w':
// $timeStr = date('w') == 1 ? 'Monday' : 'last Monday';
// $returnTime['startTime'] = date("Y-m-d", strtotime("$timeStr")) . ' 00:00:00';
// $returnTime['endTime'] = date("Y-m-d", strtotime("Sunday")) . ' 23:59:59';
// break;
// case 'lastweek': // 上周
// case 'lw':
// $timeStr = date('w') == 1 ? 'last Monday' : 'last Monday -7 days';
// $returnTime['startTime'] = date("Y-m-d", strtotime("$timeStr")) . ' 00:00:00';
// $returnTime['endTime'] = date("Y-m-d", strtotime("last Sunday")) . ' 23:59:59';
// break;
// case 'nextweek': // 下周
// case 'nw':
// $timeStr = date('w') == 2 ? 'Monday 7 days' : 'Monday';
// $returnTime['startTime'] = date("Y-m-d", strtotime("$timeStr")) . ' 00:00:00';
// $returnTime['endTime'] = date("Y-m-d", strtotime("Sunday 7 days")) . ' 23:59:59';
// break;
// case 'halfmonth': // 半个月
// case 'hm':
// $timeStr = date('w') == 1 ? 'last Monday' : 'last Monday -7 days';
// $returnTime['startTime'] = date("Y-m-d", strtotime("$timeStr")) . ' 00:00:00';
// $returnTime['endTime'] = date("Y-m-d", strtotime("Sunday")) . ' 23:59:59';
// break;
// case 'month': // 本月
// case 'm':
// $returnTime['startTime'] = date("Y-m-01") . ' 00:00:00';
// $returnTime['endTime'] = date('Y-m-t') . ' 23:59:59';
// break;
// case 'lastmonth': // 上个月
// case 'lm':
// $returnTime['startTime'] = date("Y-m-01", strtotime("last month")) . ' 00:00:00';
// $returnTime['endTime'] = date('Y-m-t', strtotime("last month")) . ' 23:59:59';
// break;
// case 'nextmonth': // 下个月
// case 'nm':
// $returnTime['startTime'] = date("Y-m-01", strtotime("next month")) . ' 00:00:00';
// $returnTime['endTime'] = date('Y-m-t', strtotime("next month")) . ' 23:59:59';
// break;
// case 'lastquarter': // 上季度
// case 'lq':
// $season = ceil((date('n')) / 3); // 当月是第几季度
// if ($season == 1) {
// $returnTime['startTime'] = date("Y-10-01", strtotime("last year")) . ' 00:00:00';
// $returnTime['endTime'] = date("Y-12-31", strtotime("last year")) . ' 23:59:59';
// } else {
// $season = $season - 1;
// $returnTime['startTime'] = date("Y-" . sprintf("%02d", ($season * 3 - 2)) . "-01") . ' 00:00:00';
// $returnTime['endTime'] = date("Y-" . sprintf("%02d", $season * 3) . "-t") . ' 23:59:59';
// }
// break;
// case 'nextquarter': // 下季度
// case 'nq':
// $season = ceil((date('n')) / 3); // 当月是第几季度
// if ($season == 4) {
// $returnTime['startTime'] = date("Y-01-01", strtotime("next year")) . ' 00:00:00';
// $returnTime['endTime'] = date("Y-03-31", strtotime("next year")) . ' 23:59:59';
// } else {
// $season = $season + 1;
// $returnTime['startTime'] = date("Y-" . sprintf("%02d", ($season * 3 - 2)) . "-01") . ' 00:00:00';
// $returnTime['endTime'] = date("Y-" . sprintf("%02d", $season * 3) . "-t") . ' 23:59:59';
// }
// break;
// case 'quarter': // 本季度
// case 'q':
// $season = ceil((date('n')) / 3); // 当月是第几季度
// $returnTime['startTime'] = date("Y-" . sprintf("%02d", ($season * 3 - 2)) . "-01") . ' 00:00:00';
// $returnTime['endTime'] = date("Y-" . sprintf("%02d", $season * 3) . "-t") . ' 23:59:59';
// break;
// case 'year': // 本年
// case 'y':
// $returnTime['startTime'] = date("Y-01-01") . ' 00:00:00';
// $returnTime['endTime'] = date('Y-12-31') . ' 23:59:59';
// break;
// case 'lastyear': // 前年
// case 'ly':
// $returnTime['startTime'] = date("Y-01-01", strtotime("last year")) . ' 00:00:00';
// $returnTime['endTime'] = date('Y-12-31', strtotime("last year")) . ' 23:59:59';
// break;
// case 'lastyear2': // 前两年
// case 'ly2':
// $returnTime['startTime'] = date("Y-01-01", strtotime("-2 year")) . ' 00:00:00';
// $returnTime['endTime'] = date("Y-12-31", strtotime("-2 day")) . ' 23:59:59';
// break;
// case 'lastyear3': // 前三年
// case 'ly3':
// $returnTime['startTime'] = date("Y-01-01", strtotime("-3 year")) . ' 00:00:00';
// $returnTime['endTime'] = date("Y-12-31", strtotime("-3 day")) . ' 23:59:59';
// break;
// case 'nextyear': // 下年
// case 'ny':
// $returnTime['startTime'] = date("Y-01-01", strtotime("next year")) . ' 00:00:00';
// $returnTime['endTime'] = date('Y-12-31', strtotime("next year")) . ' 23:59:59';
// break;
// default:
// $returnTime['startTime'] = '';
// $returnTime['endTime'] = '';
// break;
// }
// // 根据需要的时间格式返回对应的时间数据
// if ($timeFormat == 'stamp') {
// $returnTime['startTime'] = strtotime($returnTime['startTime']);
// $returnTime['endTime'] = strtotime($returnTime['endTime']);
// }
// return $returnTime;
// }
// }
// if (!function_exists("returnData")) {
// /**
// * 统一返回
// * @param $status 返回状态
// * @param $result 返回的数据结果
// * 2000 : 成功 , 5000 : 失败 ,
// */
// function returnData($status = '2000', $msg = '成功', $result = array())
// {
// $str = ['status' => $status, 'msg' => $msg, 'result' => $result];
// return json_encode(unserialize(str_replace(array('NAN;', 'INF;'), '0;', serialize($str))));
// // return json_encode(['status'=>$status, 'msg'=>$msg, 'result'=>$result]);
// }
// }
// if (!function_exists("format_data")) {
// /**
// * 格式化返回数据
// * @param int $code 1成功 0失败
// * @param array $data 返回的数据
// * @param string $msg 返回的信息
// * @time 2021年4月23日09:10:04
// * @author chenchen
// */
// function format_data($code = 0, $data = [], $msg = '')
// {
// $res = [
// 'code' => $code,
// 'data' => $data,
// 'msg' => $msg
// ];
// return $res;
// }
// }
// if (!function_exists("del_menus")) {
// /**
// * 根据父级id 删除所有子集菜单(包括当前父级)
// * @param int $id 菜单id
// * @time 2021-6-11 18:08:46
// * @author chenchen
// */
// function del_menus($id)
// {
// $parent = \app\admin\model\Menu::where(["id" => $id])->delete();
// if ($parent) {
// $child = \app\admin\model\Menu::where(["pid" => $id])->select();
// if (count($child) > 0) {
// foreach ($child as $v) {
// del_menus($v["id"]);
// }
// }
// }
// return format_data(1, [], 'ok');
// }
// }
// if (!function_exists("post_json_data")) {
// /**
// * Notes: curl 发送post请求
// * User: chenchen
// * Date: 2021/7/3
// * Time: 14:31
// * @param $url string 请求地址
// * @param $data_string string 请求数据
// * @return array
// */
// function post_json_data($url, $data_string)
// {
// //初始化
// $ch = curl_init();
// //设置post方式提交
// curl_setopt($ch, CURLOPT_POST, 1);
// //设置抓取的url
// curl_setopt($ch, CURLOPT_URL, $url);
// //设置post数据
// curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
// //设置头文件的信息作为数据流输出
// curl_setopt($ch, CURLOPT_HTTPHEADER, array(
// 'Content-Type: application/json; charset=utf-8',
// 'Content-Length: ' . strlen($data_string))
// );
// ob_start();
// //执行命令
// curl_exec($ch);
// $return_content = ob_get_contents();
// ob_end_clean();
// $return_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// return array('code' => $return_code, 'result' => $return_content);
// }
// }
// if (!function_exists("camel_2_snake")) {
// /**
// * 驼峰转蛇形
// * @param $value
// * @return string
// */
// function camel_2_snake($value)
// {
// // 以 UTF-8 模式删除空字符
// $value = preg_replace('/\s+/u', '', $value);
// // “?=”为正向预查,在任何开始匹配圆括号内的正则表达式模式的位置来匹配搜索字符串
// // 这里的正则表达式匹配所有大写字符的前一个字符
// $value = strtolower(preg_replace('/(.)(?=[A-Z])/u', "$1_", $value));
// return $value;
// }
// }
// if (!function_exists('get_channel_name')) {
// /**
// * 获取会员昵称
// * @param $id 会员id
// * @return void
// * @author yuzubo [ yuzubo@zhongbenjituan.com ]
// */
// function get_channel_name($id)
// {
// $channel = \app\crm\model\AccountChanel::where(['aid' => $id])->find();
// if ($channel['pid']) {
// $pchannel = \app\crm\model\AccountChanel::where(['aid' => $channel['pid']])->value('name');
// return $pchannel;
// } else {
// return $channel['name'];
// }
// }
// }
// //获取沟通方式
// if (!function_exists('get_consulting_way')) {
// function get_consulting_way($way)
// {
// $arr = ['在线聊天', '微信', '电话', '旺旺', '信息流表单', '短信', '留言', 'QQ', '投标'];
// return $arr[$way];
// }
// }
// if (!function_exists('set_date')) {
// /**
// * 获取会员昵称
// * @param $str 会员id
// * @return void
// * @author yuzubo [ yuzubo@zhongbenjituan.com ]
// */
// function set_date($str)
// {
// if (empty(trim($str))) {
// return '';
// }
// $a1 = explode(' ', $str);
// $day = explode('-', $a1[0]);
// $new = $day[1] . '-' . $day[2];
// $fen = explode(':', $a1[1]);
// $new = $new . ' ' . $fen[0] . ':' . $fen[1];
// return $new;
// }
// }
// if (!function_exists('filter_str_double_curly_braces')) {
// /**
// * 过滤双花括号
// * @param $str
// * @return string
// */
// function filter_str_double_curly_braces($str)
// {
// return str_replace(["{{", "}}"], ["【", "】"], $str);
// }
// }
// /**
// * 添加客户日志
// * @param $customer_id
// * @param $log
// */
// function addCustomerLog($customer_id, $log)
// {
// $data = [
// 'uid' => 0,
// 'customer_id' => $customer_id,
// 'log' => $log
// ];
// $rs = \app\crm\model\CustomerLog::create($data);
// return $rs ? true : false;
// }
// if (!function_exists('get_level_data')) {
// /**
// * 获取联动数据
// * @param string $table 表名
// * @param int $pid 父级ID
// * @param string $pid_field 父级ID的字段名
// * @return array|string|\think\Collection
// * @throws \think\db\exception\DataNotFoundException
// * @throws \think\db\exception\ModelNotFoundException
// * @throws \think\exception\DbException
// * @author 似水星辰 [2630481389@qq.com]
// */
// function get_level_data($table = '', $pid = 0, $pid_field = 'pid')
// {
// if ($table == '') {
// return '';
// }
// $data_list = Db::name($table)->where($pid_field, $pid)->where('is_del', 0)->select();
// if ($data_list) {
// return $data_list;
// } else {
// return '';
// }
// }
// }
// if (!function_exists('get_level_pid')) {
// /**
// * 获取联动等级和父级id
// * @param string $table 表名
// * @param int $id 主键值
// * @param string $id_field 主键名
// * @param string $pid_field pid字段名
// * @return mixed
// * @author 似水星辰 [2630481389@qq.com]
// */
// function get_level_pid($table = '', $id = 1, $id_field = 'id', $pid_field = 'pid')
// {
// return Db::name($table)->where($id_field, $id)->value($pid_field);
// }
// }
// //获取回款方式
// if (!function_exists('get_pay_type')) {
// function get_pay_type($data)
// {
// $info = Db::name('crm_pay_chanel')->where('aid', $data)->find();
// $res = [
// 'pay_type_id' => $info ? $info['aid'] : 0,
// 'pay_type_name' => $info ? $info['name'] . '-' . $info['account'] : '其他方式'
// ];
// return $res;
// }
// }
// if (!function_exists('get_customer')) {
// /**
// * 获取会员昵称
// * @param $id 会员id
// * @return void
// * @author yuzubo [ yuzubo@zhongbenjituan.com ]
// */
// function get_customer($id)
// {
// $name = Db::name('crm_customer')->where('aid', $id)->value('name');
// return (empty($name)) ? '暂未填写' : $name;
// }
// }
// if (!function_exists('set_date_year')) {
// /**
// * 获取会员昵称
// * @param $str 会员id
// * @return void
// * @author yuzubo [ yuzubo@zhongbenjituan.com ]
// */
// function set_date_year($str)
// {
// if (empty(trim($str))) {
// return '';
// }
// $a1 = explode(' ', $str);
// $day = explode('-', $a1[0]);
// $new = $day[0] . '-' . $day[1] . '-' . $day[2];
// $fen = explode(':', $a1[1]);
// $new = $new . ' ' . $fen[0] . ':' . $fen[1];
// return $new;
// }
// }
// if (!function_exists('column_as_key')) {
// /**
// * 提取二维数组的某个字段,作为 key ,返回新数组
// * @param array $param
// * @param string $column
// * @return array new Array
// */
// function column_as_key($param, $column)
// {
// $is_arr = is_array($param);
// $result = array();
// foreach ($param as $k => $item) {
// if ($is_arr) {
// $i = isset($item[$column]) ? $item[$column] : $k;
// } else {
// $i = $item->$column;
// }
// $result[$i] = $item;
// }
// return $result;
// }
// }
// if (!function_exists('buildIds')) {
// /**
// * 创建 IDs,可用于 IN 查询
// * @param array $array 查询结果 数组
// * @param string $key 待创建的 字段(int 型)
// * @return string 可直接用于 IN 查询的条件
// */
// function buildIds(array $array, $column, $expiry = ',')
// {
// if (empty($array)) {
// return "";
// }
// return join($expiry, array_filter(array_unique(array_column($array, $column))));
// }
// }
// if (!function_exists('exportExcel')) {
// /**
// * 导出excel
// * @param $expTitle
// * @param $expCellName
// * @param $expTableData
// */
// function exportExcel($expTitle, $expCellName, $expTableData)
// {
// include_once '../vendor/phpoffice/phpexcel/Classes/PHPExcel.php';//方法二
// $xlsTitle = iconv('utf-8', 'gb2312', $expTitle);//文件名称
// $fileName = $expTitle . date('_YmdHis');//or $xlsTitle 文件名称可根据自己情况设定
// $cellNum = count($expCellName);
// //$objPHPExcel = new PHPExcel();//方法一
// $objPHPExcel = new \PHPExcel();//方法二
// $cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ');
// $objPHPExcel->getActiveSheet()->mergeCells('A1:' . $cellName[$cellNum - 1] . '1');//合并单元格
// foreach ($expTableData as $k => $v) {
// $objPHPExcel->createSheet($k);
// $dataNum = count($v['list']);
// // $objPHPExcel->getActiveSheet($k)->mergeCells('A1:' . $cellName[$cellNum - 1] . '1');//合并单元格
// $objPHPExcel->setActiveSheetIndex($k)->setCellValue('A1', $expTitle . ' 导出时间:' . date('Y-m-d H:i:s'));
// // $objPHPExcel->getActiveSheet($k)->setTitle($v['sender']);
// for ($i = 0; $i < $cellNum; $i++) {
// $objPHPExcel->setActiveSheetIndex($k)->setCellValue($cellName[$i] . '2', $expCellName[$i][1]);
// }
// // Miscellaneous glyphs, UTF-8
// for ($i = 0; $i < $dataNum; $i++) {
// for ($j = 0; $j < $cellNum; $j++) {
// $objPHPExcel->getActiveSheet($k)->setCellValue($cellName[$j] . ($i + 3), $v['list'][$i][$expCellName[$j][0]]);
// }
// }
// }
// ob_end_clean();//这一步非常关键,用来清除缓冲区防止导出的excel乱码
// header('pragma:public');
// header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $xlsTitle . '.xls"');
// header("Content-Disposition:attachment;filename=$fileName.xls");//"xls"参考下一条备注
// $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');//"Excel2007"生成2007版本的xlsx,"Excel5"生成2003版本的xls
// $objWriter->save('php://output');
// exit;
// }
// }
// if (!function_exists('generateTree')) {
// /**
// * 无限极分类树
// * @param array $data 数据源
// * @param string $id id字段名
// * @param string $pid 父级id字段名
// * @return array
// */
// function generateTree($data, $id = "id", $pid = "pid")
// {
// $items = $tree = [];
// foreach ($data as &$v) {
// $items[$v[$id]] = $v;
// }
// foreach ($items as $k => $item) {
// if (isset($items[$item[$pid]])) {
// $items[$item[$pid]]['children'][] = &$items[$k];
// } else {
// $tree[] = &$items[$k];
// }
// }
// return $tree;
// }
// }
// if (!function_exists('education')) {
// /**
// * 学历信息
// * @param int $type 类型:0全部,1匹配单信息
// * @param int $id
// * @return array|mixed|string
// */
// function education($type = 0,$id = 0)
// {
// $edu = [
// ['id'=>1,'title'=>'无'],
// ['id'=>2,'title'=>'初中'],
// ['id'=>3,'title'=>'高中'],
// ['id'=>4,'title'=>'大专'],
// ['id'=>5,'title'=>'本科'],
// ['id'=>6,'title'=>'硕士'],
// ['id'=>7,'title'=>'博士'],
// ['id'=>8,'title'=>'其他'],
// ];
// if ($type>0){
// $info = array_column($edu,null,'id');
// $edu = $info[$id]['title'] ?? '';
// }
// return $edu;
// }
// }
// if (!function_exists('numberTrans')) {
// /**
// * 数字转化
// * @param int
// */
// function numberTrans($number = 0)
// {
// if(bccomp($number,10000,2) == -1){
// return $number;
// }
// if(bccomp($number,100000000,2) == 1){
// return bcdiv($number,100000000,2) . "亿";
// }
// if(bccomp($number,10000,2) == 1){
// return bcdiv($number,10000,2) . "万";
// }
// }
// }
系统发生错误
$available = true;
}
// 模块初始化
if ($module && $available) {
// 初始化模块
$this->request->setModule($module);
$this->app->init($module);
} else {
throw new HttpException(404, 'module not exists:' . $module);
}
}
// 是否自动转换控制器和操作名
$convert = is_bool($this->convert) ? $this->convert : $this->rule->getConfig('url_convert');
// 获取控制器名
$controller = strip_tags($result[1] ?: $this->rule->getConfig('default_controller'));
$this->controller = $convert ? strtolower($controller) : $controller;
Environment Variables
Server/Request Data
| USER |
www |
| HOME |
/home/www |
| HTTP_ACCEPT_ENCODING |
gzip, br, zstd, deflate |
| HTTP_USER_AGENT |
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
| HTTP_ACCEPT |
*/* |
| HTTP_HOST |
xbk.vrprism.com |
| PATH_INFO |
|
| REDIRECT_STATUS |
200 |
| SERVER_NAME |
xbk.vrprism.com |
| SERVER_PORT |
443 |
| SERVER_ADDR |
172.26.130.52 |
| REMOTE_PORT |
9439 |
| REMOTE_ADDR |
216.73.216.31 |
| SERVER_SOFTWARE |
nginx/1.17.10 |
| GATEWAY_INTERFACE |
CGI/1.1 |
| HTTPS |
on |
| REQUEST_SCHEME |
https |
| SERVER_PROTOCOL |
HTTP/2.0 |
| DOCUMENT_ROOT |
/xiangmu/www/xbk/public |
| DOCUMENT_URI |
/index.php |
| REQUEST_URI |
/sitemap.xml |
| SCRIPT_NAME |
/index.php |
| CONTENT_LENGTH |
|
| CONTENT_TYPE |
|
| REQUEST_METHOD |
GET |
| QUERY_STRING |
s=/sitemap.xml |
| SCRIPT_FILENAME |
/xiangmu/www/xbk/public/index.php |
| FCGI_ROLE |
RESPONDER |
| PHP_SELF |
/index.php |
| REQUEST_TIME_FLOAT |
1789100287.7646 |
| REQUEST_TIME |
1789100287 |
Environment Variablesempty
ThinkPHP Constants
| ROOT_PATH |
/xiangmu/www/xbk/public/../ |
| APP_PATH |
/xiangmu/www/xbk/public/../application/ |
ThinkPHP
V5.1.34 LTS
{ 十年磨一剑-为API开发设计的高性能框架 }