From 43d9b35318f9f06eee5f2f6754bfc8b528b4bc62 Mon Sep 17 00:00:00 2001 From: dengbw Date: Thu, 16 Sep 2021 10:20:44 +0800 Subject: [PATCH] admin_loans_916 --- common/helpers/comm_helper.php | 127 ++++++++---------- .../order/Receiver_order_loans_model.php | 2 +- 2 files changed, 60 insertions(+), 69 deletions(-) diff --git a/common/helpers/comm_helper.php b/common/helpers/comm_helper.php index 3740b4fe..493b1c58 100644 --- a/common/helpers/comm_helper.php +++ b/common/helpers/comm_helper.php @@ -133,7 +133,7 @@ if (!function_exists('debug_log')) { $string = var_export($string, TRUE); } list($msec, $sec) = explode(' ', microtime()); - fwrite($handle, date('H:i:s') .' '.floatval($msec)*1000 . PHP_EOL . $string . PHP_EOL); + fwrite($handle, date('H:i:s') . ' ' . floatval($msec) * 1000 . PHP_EOL . $string . PHP_EOL); fclose($handle); return true; @@ -374,16 +374,27 @@ if (!function_exists('send_sms')) { function send_sms($mobile, $code) { require_once COMMPATH . '/third_party/alisms/alisms.php'; - $sign = '狸车'; $template = 'SMS_218630210'; $alisms = new AliSms(); $alisms->sendSms($mobile, array('code' => $code), $template, $sign); - return true; } } +if (!function_exists('send_sms')) { + function send_sms_content($mobile, $content) + { + require_once COMMPATH . '/third_party/alisms/alisms.php'; + $sign = '狸车'; + $template = 'SMS_218630210'; + $alisms = new AliSms(); + $alisms->sendSms($mobile, array('content' => $content), $template, $sign); + return true; + } +} + + /** * 北京亿美短信 */ @@ -397,32 +408,6 @@ if (!function_exists('b2m_send_sms')) { } } -/* - * 小鱼短信 - */ -if (!function_exists('xiaoyu_sms_api')) { - function xiaoyu_sms_api($mobile, $content, $code) - { - $CI = &get_instance(); - $CI->load->helper('xiaoyuapi'); - $ip = $CI->input->ip_address(); - - $data = format_url_data(array( - 'action' => 'sendSms', - 'mobile' => $mobile, - 'content' => $content, - 'code' => $code, - 'ip' => $ip - )); - - $auth = xiaoyu_authcode($data, 'ENCODE', 'Jodi%923jos88'); - $url = "http://api.xiaoyu.com/pc"; - $result = post_to_url($url, array('auth' => $auth), $err); - $result = json_decode($result, true); - - return $result; - } -} /* * 随机码 */ @@ -496,7 +481,7 @@ if (!function_exists('build_qiniu_image_url')) { } //有些保存完整url的替换域名,支持小鱼域名,不替换 - if('xiaoyu' != $type){ + if ('xiaoyu' != $type) { $thumb = str_replace("qimg.shequ.xiaoyu.com", "qimg.haodian.cn", $thumb); } @@ -849,12 +834,13 @@ if (!function_exists('number_format_com')) { /** * 获取当前协议类型 + * @return string * @author:xxb * @time:2021/03/02 - * @return string */ -if (!function_exists('server_http')){ - function server_http(){ +if (!function_exists('server_http')) { + function server_http() + { if (false !== strpos($_SERVER['HTTP_HOST'], 'dev')) { //dev 测试 $http = 'http://'; } elseif (false !== strpos($_SERVER['HTTP_HOST'], 'test')) {//test 测试 @@ -873,31 +859,32 @@ if (!function_exists('server_http')){ * @param string $type * @return string */ -if (!function_exists('http_host_com')){ - function http_host_com($type = 'api'){ +if (!function_exists('http_host_com')) { + function http_host_com($type = 'api') + { $url = ''; - if(false !== strpos($_SERVER['HTTP_HOST'], 'dev')){ //dev 测试 - if($type == 'api'){ + if (false !== strpos($_SERVER['HTTP_HOST'], 'dev')) { //dev 测试 + if ($type == 'api') { $url = 'https://liche-api-dev.xiaoyu.com'; - } else if($type == 'home'){ + } else if ($type == 'home') { $url = "https://liche-dev.xiaoyu.com"; - } else if($type == 'admin'){ + } else if ($type == 'admin') { $url = "http://liche-admin.dev.xiaoyu.com"; } - } elseif(false !== strpos($_SERVER['HTTP_HOST'], 'test')) {//test 测试 - if($type == 'api'){ + } elseif (false !== strpos($_SERVER['HTTP_HOST'], 'test')) {//test 测试 + if ($type == 'api') { $url = 'api.lc.haodian.cn'; - } else if($type == 'home'){ + } else if ($type == 'home') { $url = "https://www-test.liche.cn"; - } else if($type == 'admin'){ + } else if ($type == 'admin') { $url = "https://admin.test.liche.cn"; } } else { // 正式 - if($type == 'api'){ + if ($type == 'api') { $url = 'https://api.liche.cn'; - } else if($type == 'home'){ + } else if ($type == 'home') { $url = "https://www.liche.cn"; - } else if($type == 'admin'){ + } else if ($type == 'admin') { $url = "https://admin.liche.cn"; } } @@ -915,12 +902,13 @@ if (!function_exists('http_host_com')){ * @param int $sort_type * @return bool */ -if(!function_exists('sort_array')){ - function sort_array($arrays, $sort_key, $sort_order = SORT_ASC, $sort_type = SORT_NUMERIC){ +if (!function_exists('sort_array')) { + function sort_array($arrays, $sort_key, $sort_order = SORT_ASC, $sort_type = SORT_NUMERIC) + { $key_arrays = array(); - if(is_array($arrays)){ - foreach($arrays as $array){ - if(is_array($array)){ + if (is_array($arrays)) { + foreach ($arrays as $array) { + if (is_array($array)) { $key_arrays[] = $array[$sort_key]; } else { return false; @@ -936,8 +924,9 @@ if(!function_exists('sort_array')){ /* * 随机获取用户名 */ -if(!function_exists('rand_name')){ - function rand_name(){ +if (!function_exists('rand_name')) { + function rand_name() + { $fam_arr = array( '赵', '钱', '孙', '李', '周', '吴', '郑', '王', '冯', '陈', '褚', '卫', '蒋', '沈', '韩', '杨', '朱', '秦', '尤', '许', '何', '吕', '施', '张', '孔', '曹', '严', '华', '金', '魏', @@ -985,13 +974,14 @@ if(!function_exists('rand_name')){ } } -if(!function_exists('html_text')){ +if (!function_exists('html_text')) { /** * 提取html文字 * @param $html * @return mixed|string */ - function html_text($html){ + function html_text($html) + { //把HTML实体标签转换为字符 $html_string = htmlspecialchars_decode($html); //将空格回车替换成空 @@ -1006,7 +996,7 @@ if(!function_exists('html_text')){ } } -if(!function_exists('formart_bank_number')){ +if (!function_exists('formart_bank_number')) { /** * 处理银行卡号每四位一个空格 * @param $str @@ -1018,28 +1008,29 @@ if(!function_exists('formart_bank_number')){ return $str; } //通过正则,每四位截取到数组中 - preg_match('/([\d]{4})([\d]{4})([\d]{4})([\d]{4})([\d]{0,})?/', $str,$match); + preg_match('/([\d]{4})([\d]{4})([\d]{4})([\d]{4})([\d]{0,})?/', $str, $match); unset($match[0]); //去除掉第一个键,因为第一个键是银行卡号的完整卡号 return implode(' ', $match); } } -if(!function_exists('convert_url_query')){ +if (!function_exists('convert_url_query')) { /** * 将字符串参数变为数组 * @param $query * @return array array() */ - function convert_url_query($query){ - $queryParts = explode('&', $query); - $params = array(); - foreach ($queryParts as $param) { - $item = explode('=', $param); - $params[$item[0]] = $item[1]; - } - return $params; + function convert_url_query($query) + { + $queryParts = explode('&', $query); + $params = array(); + foreach ($queryParts as $param) { + $item = explode('=', $param); + $params[$item[0]] = $item[1]; + } + return $params; } } -if(!function_exists('create_contract_no')){ +if (!function_exists('create_contract_no')) { /** * 生成合同编号 * int $city_id @@ -1048,7 +1039,7 @@ if(!function_exists('create_contract_no')){ */ function create_contract_no($city_id = 350200, $id, $type = 0) { - return $city_id . $type . $id . date('Ymd') . sprintf("%06d", rand(1,999999)); + return $city_id . $type . $id . date('Ymd') . sprintf("%06d", rand(1, 999999)); } } diff --git a/common/models/receiver/order/Receiver_order_loans_model.php b/common/models/receiver/order/Receiver_order_loans_model.php index dd2513d0..2a0c86f9 100644 --- a/common/models/receiver/order/Receiver_order_loans_model.php +++ b/common/models/receiver/order/Receiver_order_loans_model.php @@ -11,7 +11,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); class Receiver_order_loans_model extends HD_Model { private $table_name = 'lc_receiver_order_loans'; - private $status_arr = [ 0 => '审核中',1 => '已放款']; + private $status_arr = [ 0 => '审核中',1 => '已通过']; public function __construct() {