提交代码
This commit is contained in:
43
app/Helpers/helpers.php
Normal file
43
app/Helpers/helpers.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
use Encore\Admin\Config\ConfigModel;
|
||||
|
||||
if(!function_exists('deliver_list')){
|
||||
function deliver_list()
|
||||
{
|
||||
$deliver_list = ConfigModel::where('name','deliver_list')->value('value');
|
||||
$array = preg_split('/[\r\n]+/', trim($deliver_list, "\r\n"));
|
||||
if(strpos($deliver_list, ':')){
|
||||
$options = [];
|
||||
foreach ($array as $val) {
|
||||
[$k, $v] = explode(':', $val, 2);
|
||||
$options[$k] = $v;
|
||||
}
|
||||
} else {
|
||||
$options = $array;
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('get_deliver_name')){
|
||||
function get_deliver_name($value)
|
||||
{
|
||||
$deliver_list = deliver_list();
|
||||
|
||||
return $deliver_list[$value]??'未知';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if(!function_exists('getMobileType')){
|
||||
// function getMobileType($mobile)
|
||||
// {
|
||||
// if(preg_match('#([\d])\1{2}$#', $mobile)){
|
||||
// return 'AAA';
|
||||
// }
|
||||
// return 1;
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user