Documentation

Documentation

Table of Contents

Packages

Application
Medoo
system

Namespaces

helper_v3
Medoo
thefunpower
lib

Classes

di
global $di; $di = new di(); $di->adapter = new adapter();
SCSS
license
pg_pager_html
<code> 类似淘宝分页
rpc_php
Vue
用于生成vue2或vue3的JS代码
Yii_CJavaScriptExpression
CJavaScriptExpression represents a JavaScript expression that does not need escaping.

Constants

DS  = \DIRECTORY_SEPARATOR
HELPER_DIR  = __DIR__

Functions

predis()  : mixed
redis
predis_add_geo()  : mixed
添加位置信息 predis_add_geo('places',[ [ 'lng'=>'116.397128', 'lat'=>'39.916527', 'title'=>'北京天安门' ], ]);
predis_delete_geo()  : mixed
删除位置信息
predis_get_pager()  : mixed
返回附近的地理位置 pr(predis_get_pager('places', 116.403958, 39.915049)); http://redisdoc.com/geo/georadius.html
predis_geo_pos()  : mixed
取lat lng
array_to_pager()  : mixed
分组分页
get_url_remove_http()  : mixed
返回URL路径,不含有域名部分
get_ext_by_url()  : mixed
取后缀
get_mime()  : mixed
取mime
get_remote_file()  : mixed
获取远程URL内容
download_file()  : mixed
下载文件 建议使用 download_file_safe
download_file_safe()  : mixed
下载资源文件到本地
download_remote_file()  : mixed
下载远程文件 global $remote_to_local_path; $remote_to_local_path = '/uploads/saved/'.date("Y-m-d");
curl_aliyun()  : mixed
调用阿里云
success_data()  : mixed
返回成功的json信息
error_data()  : mixed
返回失败的json信息
get_path_info()  : mixed
pathinfo /index.php/admin/auth/index?code=2 返回 admin/auth/index 数组时返回 ['admin','auth','index']
router_pathinfo()  : mixed
支持pathinfo路由 未找到请用 pathinfo_not_find 函数
make_rand_code()  : mixed
生成数字随机数 一般用于核销 需要表名 rand_code 字段 nid code status默认0
update_make_rand_code()  : mixed
核销后需要释放核销码
set_lock()  : mixed
锁功能已替代 lock_call('k',functon(){
get_lock()  : mixed
获取是否锁定
del_lock()  : mixed
释放锁定
json_replace()  : mixed
json数据替换
remove_php_notes()  : mixed
去除PHP代码注释
online_view_office()  : mixed
在线查看office文件
printfs()  : mixed
格式化输出金额 强制输出数字类型
float_noup()  : mixed
float不进位,如3.145 返回3.14 进位的有默认round(3.145) 或sprintf("%.2f",3.145);
float_up()  : mixed
四舍五入
load_xls()  : mixed
加载xlsx load_xls([ 'file' => $xls, 'config'=>[ '序号' =>'index', ], 'title_line'=>1, 'call'=>function($i,$row,&$d){} ]);
get_lines()  : mixed
获取文件行数,不包空行
get_request_top()  : mixed
返回请求中是http还是https
get_request_host()  : mixed
返回请求域名及URL部分,不包含http://
auto_jump()  : mixed
自动跳转到https网站
get_http_full_url()  : mixed
get_index_array_valule()  : mixed
从数组中搜索
gbk_substr()  : mixed
get_gbk_len()  : mixed
GBK长宽 2个字符
get_text_c()  : mixed
文字居中
get_text_lr()  : mixed
文字排版 左 中 右 左 右
allow_cross_origin()  : mixed
处理跨域
to_utf8()  : mixed
csv_reader()  : mixed
csv_writer()  : mixed
lock_call()  : mixed
基于redis锁
lock_start()  : mixed
开始锁
lock_end()  : mixed
释放锁
compare_date()  : mixed
redis_pub()  : mixed
发布消息 redis_pub("demo","welcome man"); redis_pub("demo",['title'=>'yourname']);
redis_sub()  : mixed
取订阅消息 redis_sub("demo",function($channel,$message){ echo "channel ".$channel."\n"; print_r($message); });
send_pusher()  : mixed
think_check_sign()  : mixed
think_create_sign()  : mixed
get_str_ord()  : mixed
gz_encode()  : mixed
gz_decode()  : mixed
html_to_pdf()  : mixed
get_barcode()  : mixed
https://github.com/picqer/php-barcode-generator/blob/main/src/BarcodeGenerator.php C128 C128A C128B C128C C93 EAN13 EAN8 EAN2
text_add_br()  : mixed
get_server_headers()  : mixed
output_js_css()  : mixed
xml2array()  : mixed
array2xml()  : mixed
copy_base64_data()  : mixed
set_scss_path()  : mixed
scss()  : mixed
get_ws_js()  : mixed
HTML端收消息 wss://yourdomain/wss ws://ip:port
create_node_ws_server()  : mixed
生成node js ws服务 需要把返回的内容写入server.js中 依赖 ioredis
xis_ssl()  : mixed
xcookie()  : mixed
xcookie_delete()  : mixed
license_create()  : mixed
根据公钥生成文件
license_data()  : mixed
获取授权信息
license_data_parse()  : mixed
license_is_expire()  : bool
授权是否过期
license_near_expire()  : void
授权是否接近过期
license_html()  : mixed
pg_active_main()  : mixed
激活平台数据库连接,平台数据库不支持从库读
pg_active_read()  : mixed
激活读数据库连接
pg_active_default()  : mixed
激活默认数据库连接
pg_active()  : mixed
激活当前使用哪个数据库
get_pg_active_name()  : mixed
获取当前启用的数据库连接
pg_can_run_action()  : mixed
判断是否可运行action
pg_can_run_update()  : mixed
数据库是否可执行更新操作
new_pg()  : mixed
连接数据库
medoo_pg()  : object
数据库实例
pg()  : mixed
pg_pager()  : mixed
pg_pager_count()  : mixed
设置分页总记录数 一般情况用不到
pg_pager_html()  : mixed
显示分页 调用pg_pager后,再调用。 pg_pager_html([ 'url'=>'', ]);
pg_add_error()  : mixed
添加错误信息
pg_get_error()  : mixed
获取错误信息
pg_get()  : mixed
_pg_get()  : mixed
pg_select()  : mixed
$lists = pg_select('do_order', [ 'count' => 'COUNT(`id`)', 'total' => 'SUM(`total_fee`)', 'date' => "FROM_UNIXTIME(`inserttime`, '%Y-%m-%d')" ], 'WHERE `status` = 1 GROUP BY `date` LIMIT 30' );
pg_insert()  : array<string|int, mixed>
写入记录
pg_update()  : array<string|int, mixed>
更新记录
pg_action()  : mixed
数据库事务
pg_for_update()  : mixed
对数据进行
pg_get_one()  : array<string|int, mixed>
根据表名、字段 、条件 查寻一条记录
pg_query()  : mixed
SQL查寻
pg_get_min()  : void
取最小值 https://medoo.in/api/min min($table, $column, $where) min($table, $join, $column, $where)
pg_get_max()  : void
取最大值 max($table, $column, $where) max($table, $join, $column, $where)
pg_get_count()  : void
总数 count($table, $where) count($table, $join, $column, $where)
pg_get_has()  : void
是否有记录 has($table, $where) has($table, $join, $where)
pg_get_rand()  : void
随机取多条记录 rand($table, $column, $where) rand($table, $join, $column, $where)
pg_get_sum()  : void
取总和 sum($table, $column, $where) sum($table, $join, $column, $where)
pg_get_avg()  : void
取平均值 avg($table, $column, $where) avg($table, $join, $column, $where)
pg_raw()  : mixed
RAW https://medoo.in/api/raw raw('NOW()') raw('RAND()') raw('AVG(<age>)')
pg_del()  : mixed
pg_delete()  : mixed
pg_tables()  : void
显示所有表名
pg_fields()  : mixed
取表中字段
pg_allow()  : mixed
返回数据库允许的数据,传入其他字段自动忽略
pg_tables_markdown()  : mixed
显示数据库表结构,支持markdown格式
pg_field_json()  : mixed
取表中json字段
pg_field_is_json()  : mixed
判断表中的字段是不是json
pg_row_json_to_array()  : mixed
把数据库中json字段转成array
array_order_by()  : mixed
is_json()  : mixed
add_action()  : mixed
do_action()  : mixed
pg_between_date()  : mixed
返回两个日期之间 $date1 = '2022-11-01'; $date2 = '2022-12-14'; 字段是datetime类型
pg_between_month()  : mixed
返回两个月份之间 $date1 = '2022-11'; $date2 = '2022-12'; 字段是datetime类型
rpc_client()  : mixed
rpc_server()  : mixed
rpc_token()  : mixed
call_retry()  : mixed
尝试多次运行 $times 运行次数 $usleep_time 毫秒
array_to_tree()  : mixed
数组转tree
pr()  : mixed
数组或字符输出,方便查看
add_action()  : mixed
do_action()  : mixed
is_cli()  : mixed
is_post()  : mixed
is_json()  : mixed
array_to_object()  : mixed
object_to_array()  : mixed
get_dir()  : mixed
get_ext()  : mixed
get_name()  : mixed
create_dir_if_not_exists()  : mixed
is_local()  : mixed
get_ip()  : mixed
now()  : mixed
get_distance()  : mixed
get_deep_dir()  : mixed
price_format()  : mixed
json()  : mixed
json_error()  : mixed
json_success()  : mixed
yaml_load()  : mixed
yaml_dump()  : mixed
yaml()  : mixed
aes_encode()  : mixed
aes_decode()  : mixed
string_to_array()  : mixed
get_dates()  : mixed
get_date_china()  : mixed
timeago()  : mixed
is_ajax()  : mixed
import()  : mixed
get_reffer()  : mixed
get_root_domain()  : mixed
get_sub_domain()  : mixed
sign_by_secret()  : mixed
zip_extract()  : mixed
zip_create()  : mixed
is_json_request()  : mixed
array_to_el_select()  : mixed
echats()  : mixed
echats_reload()  : mixed
echarts()  : mixed
echarts_reload()  : mixed
set_field_allow()  : mixed
设置允许字段
get_field_allow()  : mixed
获取允许字段
get_data_allow()  : mixed
返回允许字段值
is_ssl()  : mixed
think_validate()  : mixed
validate()  : mixed
jump()  : mixed
set_url_use_cdn()  : mixed
对数组添加cdn url
push_task()  : mixed
添加到队列 "topthink/think-queue": "^3" push_task('app\printer\job\Printer',['tt'=>11],'');
loop_tree()  : mixed
向上取递归 如当前分类是3,将返回 123所有的值 $arr = loop_tree("catalog",$v['catalog_id'],true); foreach($arr as $vv){ $title[] = $vv['title']; } id pid 1 0 2 1 3 2
get_loop_tree_ids()  : mixed
向下递归
loop_del()  : mixed
递归删除
el_table_tree()  : mixed
用于tree表格排序 因为tree给的lists字段是用于显示,在排序时得到的index是不正确的, 此时需要lists_sort字段得到正确的index 在交换排序值时才能正确保存并显示
el_cascader()  : mixed
用于cascader字段 public function cascader(){ $catalog = db_get($this->table,"*",[ 'ORDER'=>catalog_default_order_by(), 'status'=>1 ]); $select = el_cascader(array_to_tree($catalog)); json_success(['data'=>$select]); } $catalog = db_get("catalog",[]); $select = el_cascader(array_to_tree($catalog));
_loop_del_tree()  : mixed
内部实现
_loop_tree_deep_inner()  : mixed
内部实现
get_xss_clean_ins()  : mixed
xss_clean_str()  : mixed
xss_clean()  : mixed
global_trim()  : mixed
global_trim_inner()  : mixed
get()  : mixed
get_req_post()  : mixed
g()  : mixed
get_input()  : mixed
guzzle_http()  : mixed
guzzle_http_fake_option()  : mixed
get_template()  : mixed
get_api_data()  : mixed
获取接口请求数据,如果存在将不发起接口请求
api_data_insert()  : mixed
记录接口请求数据
cookie()  : mixed
cookie_delete()  : mixed
active_db()  : mixed
激活数据库连接
active_db_default()  : mixed
使用默认monogo连接
db_get_group()  : mixed
group by 查寻
_db_group_con()  : mixed
mongodb groupby兼容
db_set_field_type()  : mixed
db_reset_data_by_filed_type()  : mixed
权限字段类型设置值
db_update()  : mixed
数据库更新记录
db_del()  : mixed
数据库删除记录
db_insert()  : mixed
向数据库添加记录
_db_get_when_array()  : mixed
内部调用,处理 where条件是数组的情况
db_get_one()  : mixed
数据库查寻
set_db_cache()  : mixed
设置数据库查寻字段走缓存
get_db_cache_key()  : mixed
取缓存key
get_db_cache_where()  : mixed
取缓存where
db_get_cache()  : mixed
取数据,带缓存
db_get()  : mixed
取数据
db_get_count()  : mixed
数量
db_get_sum()  : mixed
计算SUM
db_pager()  : mixed
数据库分页
db_get_pager()  : mixed
分页
db_action()  : mixed
mongodb事务
mongo_action()  : mixed
db_allow()  : mixed
数据库字段允许
db_allow_set()  : mixed
设置允许字段
get_id_by_auto_insert()  : mixed
设置或取ID
get_all_or_one()  : mixed
取一条或多条记录 get_all_or_one("novel_book",$where,'get_novel_book_row');
set_config()  : mixed
get_config()  : mixed
get_env()  : mixed
获取ENV
set_env()  : mixed
设置ENV
vue_get_jidu()  : mixed
季度 返回 k=>{0:开始 1:结束 flag:}
vue_get_jidu_array()  : mixed
每个季度开始、结束时间
vue_get_last_day()  : mixed
某月的最后一天
vue_message()  : mixed
vue message
vue_loading()  : mixed
loading效果
php_to_js()  : string
Encodes a PHP variable into javascript representation.
yii_quote()  : mixed

Constants

DS

public mixed DS = \DIRECTORY_SEPARATOR

HELPER_DIR

public mixed HELPER_DIR = __DIR__

Functions

predis()

redis

predis([mixed $host = '' ][, mixed $port = '' ][, mixed $auth = '' ]) : mixed
Parameters
$host : mixed = ''
$port : mixed = ''
$auth : mixed = ''

predis_add_geo()

添加位置信息 predis_add_geo('places',[ [ 'lng'=>'116.397128', 'lat'=>'39.916527', 'title'=>'北京天安门' ], ]);

predis_add_geo(mixed $key[, mixed $arr = [] ]) : mixed
Parameters
$key : mixed
$arr : mixed = []

predis_delete_geo()

删除位置信息

predis_delete_geo(mixed $key[, mixed $arr = [] ]) : mixed

predis_delete_geo('places',[ '北京天安门', ]);

Parameters
$key : mixed
$arr : mixed = []

predis_get_pager()

返回附近的地理位置 pr(predis_get_pager('places', 116.403958, 39.915049)); http://redisdoc.com/geo/georadius.html

predis_get_pager(mixed $key, mixed $lat, mixed $lng[, mixed $juli = 2 ][, mixed $sort = 'ASC' ][, mixed $to_fixed = 2 ]) : mixed
Parameters
$key : mixed
$lat : mixed
$lng : mixed
$juli : mixed = 2
$sort : mixed = 'ASC'
$to_fixed : mixed = 2

predis_geo_pos()

取lat lng

predis_geo_pos(mixed $key[, mixed $title = [] ][, mixed $to_fixed = 6 ]) : mixed
Parameters
$key : mixed
$title : mixed = []
$to_fixed : mixed = 6

array_to_pager()

分组分页

array_to_pager(mixed $arr) : mixed
Parameters
$arr : mixed

get_url_remove_http()

返回URL路径,不含有域名部分

get_url_remove_http(mixed $url) : mixed
Parameters
$url : mixed

get_ext_by_url()

取后缀

get_ext_by_url(mixed $url) : mixed
Parameters
$url : mixed

get_mime()

取mime

get_mime(mixed $url) : mixed
Parameters
$url : mixed

get_remote_file()

获取远程URL内容

get_remote_file(mixed $url[, mixed $is_json = false ]) : mixed
Parameters
$url : mixed
$is_json : mixed = false

download_file()

下载文件 建议使用 download_file_safe

download_file(mixed $url[, mixed $contain_http = false ]) : mixed
Parameters
$url : mixed
$contain_http : mixed = false

download_file_safe()

下载资源文件到本地

download_file_safe(mixed $url[, mixed $mimes = ['image/*', 'video/*'] ][, mixed $cons = [] ][, mixed $contain_http = false ]) : mixed
Parameters
$url : mixed
$mimes : mixed = ['image/*', 'video/*']
$cons : mixed = []
$contain_http : mixed = false

download_remote_file()

下载远程文件 global $remote_to_local_path; $remote_to_local_path = '/uploads/saved/'.date("Y-m-d");

download_remote_file(mixed $url[, mixed $path = '' ][, mixed $name = '' ]) : mixed
Parameters
$url : mixed
$path : mixed = ''
$name : mixed = ''

curl_aliyun()

调用阿里云

curl_aliyun(mixed $url[, mixed $bodys = '' ][, mixed $method = 'POST' ]) : mixed
Parameters
$url : mixed
$bodys : mixed = ''
$method : mixed = 'POST'

success_data()

返回成功的json信息

success_data(mixed $data[, mixed $msg = '' ]) : mixed
Parameters
$data : mixed
$msg : mixed = ''

error_data()

返回失败的json信息

error_data(mixed $msg) : mixed
Parameters
$msg : mixed

get_path_info()

pathinfo /index.php/admin/auth/index?code=2 返回 admin/auth/index 数组时返回 ['admin','auth','index']

get_path_info([mixed $return_array = false ]) : mixed
Parameters
$return_array : mixed = false

router_pathinfo()

支持pathinfo路由 未找到请用 pathinfo_not_find 函数

router_pathinfo([mixed $ns = 'app' ][, mixed $add_controller = 'controller' ][, mixed $ucfirst_controller = true ]) : mixed
Parameters
$ns : mixed = 'app'
$add_controller : mixed = 'controller'
$ucfirst_controller : mixed = true

make_rand_code()

生成数字随机数 一般用于核销 需要表名 rand_code 字段 nid code status默认0

make_rand_code(mixed $node_id) : mixed
Parameters
$node_id : mixed

update_make_rand_code()

核销后需要释放核销码

update_make_rand_code(mixed $node_id) : mixed
Parameters
$node_id : mixed

set_lock()

锁功能已替代 lock_call('k',functon(){

set_lock(mixed $key[, mixed $exp_time = 60 ]) : mixed

},second);

Parameters
$key : mixed
$exp_time : mixed = 60

get_lock()

获取是否锁定

get_lock(mixed $key) : mixed
Parameters
$key : mixed

del_lock()

释放锁定

del_lock(mixed $key) : mixed
Parameters
$key : mixed

json_replace()

json数据替换

json_replace( $json[,  $replace = [] ][,  $return_json = true ]) : mixed
Parameters
$json :

json格式数组或数组

$replace : = []

要替换的数组,如$replace = ['appid'=>'new appid'];

$return_json : = true

默认返回JSON格式

remove_php_notes()

去除PHP代码注释

remove_php_notes(mixed $content) : mixed
Parameters
$content : mixed

online_view_office()

在线查看office文件

online_view_office(mixed $url) : mixed
Parameters
$url : mixed

printfs()

格式化输出金额 强制输出数字类型

printfs(mixed &$v[, mixed $keys = [] ][, mixed $dot = 2 ]) : mixed
Parameters
$v : mixed
$keys : mixed = []
$dot : mixed = 2

float_noup()

float不进位,如3.145 返回3.14 进位的有默认round(3.145) 或sprintf("%.2f",3.145);

float_noup(mixed $float_number[, mixed $dot = 2 ]) : mixed
Parameters
$float_number : mixed
$dot : mixed = 2

float_up()

四舍五入

float_up(mixed $float_number[, mixed $dot = 2 ][,  $mid_val = 5 ]) : mixed
Parameters
$float_number : mixed
$dot : mixed = 2
$mid_val : = 5

逢几进位

load_xls()

加载xlsx load_xls([ 'file' => $xls, 'config'=>[ '序号' =>'index', ], 'title_line'=>1, 'call'=>function($i,$row,&$d){} ]);

load_xls([mixed $new_arr = [] ]) : mixed
Parameters
$new_arr : mixed = []

get_lines()

获取文件行数,不包空行

get_lines(mixed $file[, mixed $length = 40960 ]) : mixed
Parameters
$file : mixed
$length : mixed = 40960

get_request_top()

返回请求中是http还是https

get_request_top() : mixed

get_request_host()

返回请求域名及URL部分,不包含http://

get_request_host() : mixed

auto_jump()

自动跳转到https网站

auto_jump() : mixed

get_http_full_url()

get_http_full_url(mixed $url[, mixed $fun = 'cdn_url' ]) : mixed
Parameters
$url : mixed
$fun : mixed = 'cdn_url'

get_index_array_valule()

从数组中搜索

get_index_array_valule(mixed $array, mixed $key, mixed $val) : mixed
Parameters
$array : mixed
$key : mixed
$val : mixed

gbk_substr()

gbk_substr(mixed $text, mixed $start, mixed $len[, mixed $gbk = 'GBK' ]) : mixed
Parameters
$text : mixed
$start : mixed
$len : mixed
$gbk : mixed = 'GBK'

get_gbk_len()

GBK长宽 2个字符

get_gbk_len(mixed $value[, mixed $gbk = 'GBK' ]) : mixed
Parameters
$value : mixed
$gbk : mixed = 'GBK'

get_text_c()

文字居中

get_text_c(string $str, int $len) : mixed
Parameters
$str : string
$len : int

get_text_lr()

文字排版 左 中 右 左 右

get_text_lr(array<string|int, mixed> $arr, int $length[, mixed $return_arr = false ]) : mixed
Parameters
$arr : array<string|int, mixed>
$length : int
$return_arr : mixed = false

allow_cross_origin()

处理跨域

allow_cross_origin() : mixed

to_utf8()

to_utf8(mixed $str) : mixed
Parameters
$str : mixed

csv_reader()

csv_reader(mixed $file) : mixed
Parameters
$file : mixed

csv_writer()

csv_writer(mixed $file[, mixed $header = [] ][, mixed $content = [] ]) : mixed
Parameters
$file : mixed
$header : mixed = []
$content : mixed = []

lock_call()

基于redis锁

lock_call(mixed $key, mixed $call[, mixed $time = 10 ]) : mixed

global $redis_lock; //锁前缀 global $lock_key;

$redis_lock = [ 'host'=>'', 'port'=>'', 'auth'=>'', ];

lock_call('k',functon()},1); 或 if(lock_start('k')){ .. lock_end(); }

Parameters
$key : mixed
$call : mixed
$time : mixed = 10

lock_start()

开始锁

lock_start(mixed $key[, mixed $time = 1 ]) : mixed
Parameters
$key : mixed
$time : mixed = 1

lock_end()

释放锁

lock_end() : mixed

compare_date()

compare_date(mixed $a, mixed $b) : mixed
Parameters
$a : mixed
$b : mixed

redis_pub()

发布消息 redis_pub("demo","welcome man"); redis_pub("demo",['title'=>'yourname']);

redis_pub(mixed $channel, mixed $message) : mixed
Parameters
$channel : mixed
$message : mixed

redis_sub()

取订阅消息 redis_sub("demo",function($channel,$message){ echo "channel ".$channel."\n"; print_r($message); });

redis_sub(mixed $channel, mixed $call[, mixed $unsubscribe = false ]) : mixed
Parameters
$channel : mixed
$call : mixed
$unsubscribe : mixed = false

send_pusher()

send_pusher([mixed $data = [] ][, mixed $channel = 'netteadmin' ][, mixed $event = 'notice' ]) : mixed
Parameters
$data : mixed = []
$channel : mixed = 'netteadmin'
$event : mixed = 'notice'

think_check_sign()

think_check_sign(mixed $json_string[, mixed $key = '' ][, mixed $sign_key = 'sign' ]) : mixed
Parameters
$json_string : mixed
$key : mixed = ''
$sign_key : mixed = 'sign'

think_create_sign()

think_create_sign([mixed $arr = [] ][, mixed $key = '' ]) : mixed
Parameters
$arr : mixed = []
$key : mixed = ''

get_str_ord()

get_str_ord(mixed $str[, mixed $is_join = false ]) : mixed
Parameters
$str : mixed
$is_join : mixed = false

gz_encode()

gz_encode(mixed $arr_or_str) : mixed
Parameters
$arr_or_str : mixed

gz_decode()

gz_decode(mixed $str) : mixed
Parameters
$str : mixed

html_to_pdf()

html_to_pdf(mixed $input_html_file, mixed $output_pdf_file[, mixed $return_cmd = false ][, mixed $exec = false ]) : mixed
Parameters
$input_html_file : mixed
$output_pdf_file : mixed
$return_cmd : mixed = false
$exec : mixed = false

get_barcode()

https://github.com/picqer/php-barcode-generator/blob/main/src/BarcodeGenerator.php C128 C128A C128B C128C C93 EAN13 EAN8 EAN2

get_barcode(mixed $code[, mixed $type = 'C128' ][, mixed $widthFactor = 2 ][, mixed $height = 30 ][, mixed $foregroundColor = [0, 0, 0] ]) : mixed
Parameters
$code : mixed
$type : mixed = 'C128'
$widthFactor : mixed = 2
$height : mixed = 30
$foregroundColor : mixed = [0, 0, 0]

text_add_br()

text_add_br(mixed $text, mixed $w[, mixed $br = '<br>' ]) : mixed
Parameters
$text : mixed
$w : mixed
$br : mixed = '<br>'

get_server_headers()

get_server_headers([mixed $name = '' ]) : mixed
Parameters
$name : mixed = ''

output_js_css()

output_js_css([mixed $js = '' ][, mixed $css = '' ]) : mixed
Parameters
$js : mixed = ''
$css : mixed = ''

xml2array()

xml2array(mixed $xml) : mixed
Parameters
$xml : mixed

array2xml()

array2xml(mixed $arr[, mixed $root = '' ]) : mixed
Parameters
$arr : mixed
$root : mixed = ''

copy_base64_data()

copy_base64_data() : mixed

set_scss_path()

set_scss_path(mixed $path) : mixed
Parameters
$path : mixed

scss()

scss(mixed $css[, mixed $is_cached = false ]) : mixed
Parameters
$css : mixed
$is_cached : mixed = false

get_ws_js()

HTML端收消息 wss://yourdomain/wss ws://ip:port

get_ws_js(mixed $func[, mixed $ws = 'ws://127.0.0.1:3006' ]) : mixed
Parameters
$func : mixed
$ws : mixed = 'ws://127.0.0.1:3006'

create_node_ws_server()

生成node js ws服务 需要把返回的内容写入server.js中 依赖 ioredis

create_node_ws_server([mixed $ws_port = 3006 ][, mixed $topic = ['demo'] ][, mixed $redis_host = '127.0.0.1' ][, mixed $port = '6379' ][, mixed $auth = '' ]) : mixed
Parameters
$ws_port : mixed = 3006
$topic : mixed = ['demo']
$redis_host : mixed = '127.0.0.1'
$port : mixed = '6379'
$auth : mixed = ''

xis_ssl()

xis_ssl() : mixed

xcookie()

xcookie(mixed $name[, mixed $value = '' ][, mixed $expire = 0 ]) : mixed
Parameters
$name : mixed
$value : mixed = ''
$expire : mixed = 0

xcookie_delete()

xcookie_delete(mixed $name) : mixed
Parameters
$name : mixed

license_create()

根据公钥生成文件

license_create(mixed $data[, mixed $file = null ]) : mixed
Parameters
$data : mixed
$file : mixed = null

license_data()

获取授权信息

license_data([mixed $file = '' ]) : mixed
Parameters
$file : mixed = ''

license_data_parse()

license_data_parse(mixed &$data) : mixed
Parameters
$data : mixed

license_is_expire()

授权是否过期

license_is_expire() : bool
Return values
bool

license_near_expire()

授权是否接近过期

license_near_expire() : void

pg_active_main()

激活平台数据库连接,平台数据库不支持从库读

pg_active_main() : mixed

pg_active_read()

激活读数据库连接

pg_active_read() : mixed

pg_active_default()

激活默认数据库连接

pg_active_default() : mixed

pg_active()

激活当前使用哪个数据库

pg_active([mixed $name = 'default' ]) : mixed
Parameters
$name : mixed = 'default'

get_pg_active_name()

获取当前启用的数据库连接

get_pg_active_name() : mixed

pg_can_run_action()

判断是否可运行action

pg_can_run_action() : mixed

pg_can_run_update()

数据库是否可执行更新操作

pg_can_run_update([mixed $sql = '' ]) : mixed
Parameters
$sql : mixed = ''

new_pg()

连接数据库

new_pg([mixed $config = [] ][, mixed $name = '' ]) : mixed
Parameters
$config : mixed = []
$name : mixed = ''

medoo_pg()

数据库实例

medoo_pg() : object
Return values
object

pg_pager()

pg_pager(mixed $table, mixed $join[, mixed $columns = null ][, mixed $where = null ]) : mixed
Parameters
$table : mixed
$join : mixed
$columns : mixed = null
$where : mixed = null

pg_pager_count()

设置分页总记录数 一般情况用不到

pg_pager_count([mixed $nums = null ]) : mixed
Parameters
$nums : mixed = null

pg_pager_html()

显示分页 调用pg_pager后,再调用。 pg_pager_html([ 'url'=>'', ]);

pg_pager_html([mixed $arr = [] ]) : mixed
Parameters
$arr : mixed = []

pg_add_error()

添加错误信息

pg_add_error(mixed $str) : mixed
Parameters
$str : mixed

pg_get_error()

获取错误信息

pg_get_error() : mixed

pg_get()

pg_get(mixed $table[, mixed $join = null ][, mixed $columns = null ][, mixed $where = null ]) : mixed
Parameters
$table : mixed
$join : mixed = null
$columns : mixed = null
$where : mixed = null

_pg_get()

_pg_get(mixed $table[, mixed $join = null ][, mixed $columns = null ][, mixed $where = null ]) : mixed
Parameters
$table : mixed
$join : mixed = null
$columns : mixed = null
$where : mixed = null

pg_select()

$lists = pg_select('do_order', [ 'count' => 'COUNT(`id`)', 'total' => 'SUM(`total_fee`)', 'date' => "FROM_UNIXTIME(`inserttime`, '%Y-%m-%d')" ], 'WHERE `status` = 1 GROUP BY `date` LIMIT 30' );

pg_select(mixed $table[, mixed $join = "*" ][, mixed $columns = null ][, mixed $where = null ]) : mixed
Parameters
$table : mixed
$join : mixed = "*"
$columns : mixed = null
$where : mixed = null

pg_insert()

写入记录

pg_insert(string $table[, array<string|int, mixed> $data = [] ][, mixed $don_run_action = false ]) : array<string|int, mixed>
Parameters
$table : string

表名

$data : array<string|int, mixed> = []

数据

$don_run_action : mixed = false
Return values
array<string|int, mixed>

pg_update()

更新记录

pg_update(string $table[, array<string|int, mixed> $data = [] ][, mixed $where = [] ][, mixed $don_run_action = false ]) : array<string|int, mixed>
Parameters
$table : string

表名

$data : array<string|int, mixed> = []

数据

$where : mixed = []
$don_run_action : mixed = false
Return values
array<string|int, mixed>

pg_action()

数据库事务

pg_action(mixed $call) : mixed
Parameters
$call : mixed

pg_for_update()

对数据进行

pg_for_update(mixed $table, mixed $id) : mixed
Parameters
$table : mixed
$id : mixed

pg_get_one()

根据表名、字段 、条件 查寻一条记录

pg_get_one(string $table[, mixed $join = "*" ][, mixed $columns = null ][, array<string|int, mixed> $where = null ]) : array<string|int, mixed>
Parameters
$table : string

表名

$join : mixed = "*"
$columns : mixed = null
$where : array<string|int, mixed> = null

条件

Return values
array<string|int, mixed>

pg_query()

SQL查寻

pg_query(mixed $sql[, mixed $raw = null ]) : mixed
Parameters
$sql : mixed
$raw : mixed = null

pg_get_min()

取最小值 https://medoo.in/api/min min($table, $column, $where) min($table, $join, $column, $where)

pg_get_min(string $table[, mixed $join = "*" ][, string $column = null ][, array<string|int, mixed> $where = null ]) : void
Parameters
$table : string

表名

$join : mixed = "*"
$column : string = null

字段

$where : array<string|int, mixed> = null

条件

pg_get_max()

取最大值 max($table, $column, $where) max($table, $join, $column, $where)

pg_get_max(string $table[, mixed $join = "*" ][, string $column = null ][, array<string|int, mixed> $where = null ]) : void
Parameters
$table : string

表名

$join : mixed = "*"
$column : string = null

字段

$where : array<string|int, mixed> = null

条件

pg_get_count()

总数 count($table, $where) count($table, $join, $column, $where)

pg_get_count(string $table[, mixed $join = "*" ][, mixed $column = null ][, array<string|int, mixed> $where = null ]) : void
Parameters
$table : string

表名

$join : mixed = "*"
$column : mixed = null
$where : array<string|int, mixed> = null

条件

pg_get_has()

是否有记录 has($table, $where) has($table, $join, $where)

pg_get_has(string $table[, mixed $join = null ][, array<string|int, mixed> $where = null ]) : void
Parameters
$table : string

表名

$join : mixed = null
$where : array<string|int, mixed> = null

条件

pg_get_rand()

随机取多条记录 rand($table, $column, $where) rand($table, $join, $column, $where)

pg_get_rand(string $table[, mixed $join = "*" ][, string $column = null ][, array<string|int, mixed> $where = null ]) : void
Parameters
$table : string

表名

$join : mixed = "*"
$column : string = null

字段

$where : array<string|int, mixed> = null

条件

pg_get_sum()

取总和 sum($table, $column, $where) sum($table, $join, $column, $where)

pg_get_sum(string $table[, mixed $join = "*" ][, string $column = null ][, array<string|int, mixed> $where = null ]) : void
Parameters
$table : string

表名

$join : mixed = "*"
$column : string = null

字段

$where : array<string|int, mixed> = null

条件

pg_get_avg()

取平均值 avg($table, $column, $where) avg($table, $join, $column, $where)

pg_get_avg(string $table[, mixed $join = "*" ][, string $column = null ][, array<string|int, mixed> $where = null ]) : void
Parameters
$table : string

表名

$join : mixed = "*"
$column : string = null

字段

$where : array<string|int, mixed> = null

条件

pg_raw()

RAW https://medoo.in/api/raw raw('NOW()') raw('RAND()') raw('AVG(<age>)')

pg_raw(string $raw) : mixed
Parameters
$raw : string

pg_del()

pg_del(mixed $table, mixed $where) : mixed
Parameters
$table : mixed
$where : mixed

pg_delete()

pg_delete(mixed $table, mixed $where) : mixed
Parameters
$table : mixed
$where : mixed

pg_tables()

显示所有表名

pg_tables(string $table) : void
Parameters
$table : string

表名

Tags
version
1.0.0
author

sun sunkangchina@163.com

pg_fields()

取表中字段

pg_fields(mixed $table[, mixed $has_key = true ]) : mixed
Parameters
$table : mixed
$has_key : mixed = true

pg_allow()

返回数据库允许的数据,传入其他字段自动忽略

pg_allow(mixed $table, mixed $data) : mixed
Parameters
$table : mixed
$data : mixed

pg_tables_markdown()

显示数据库表结构,支持markdown格式

pg_tables_markdown([string $name = null ][, mixed $show_markdown = false ]) : mixed
Parameters
$name : string = null

数据库名

$show_markdown : mixed = false
Tags
version
1.0.0
author

sun sunkangchina@163.com

pg_field_json()

取表中json字段

pg_field_json(mixed $table) : mixed
Parameters
$table : mixed

pg_field_is_json()

判断表中的字段是不是json

pg_field_is_json(mixed $table, mixed $field) : mixed
Parameters
$table : mixed
$field : mixed

pg_row_json_to_array()

把数据库中json字段转成array

pg_row_json_to_array( $table_name[,  &$row_data = [] ]) : mixed
Parameters
$table_name :

表名

$row_data : = []

一行记录

array_order_by()

array_order_by() : mixed

is_json()

is_json(mixed $data[, mixed $assoc = false ]) : mixed
Parameters
$data : mixed
$assoc : mixed = false

add_action()

add_action(mixed $name, mixed $call[, mixed $level = 20 ]) : mixed
Parameters
$name : mixed
$call : mixed
$level : mixed = 20

do_action()

do_action(mixed $name[, mixed &$par = null ]) : mixed
Parameters
$name : mixed
$par : mixed = null

pg_between_date()

返回两个日期之间 $date1 = '2022-11-01'; $date2 = '2022-12-14'; 字段是datetime类型

pg_between_date(mixed $field, mixed $date1, mixed $date2) : mixed
Parameters
$field : mixed
$date1 : mixed
$date2 : mixed

pg_between_month()

返回两个月份之间 $date1 = '2022-11'; $date2 = '2022-12'; 字段是datetime类型

pg_between_month(mixed $field, mixed $date1, mixed $date2) : mixed
Parameters
$field : mixed
$date1 : mixed
$date2 : mixed

rpc_client()

rpc_client(mixed $url[, mixed $is_remote = false ]) : mixed
Parameters
$url : mixed
$is_remote : mixed = false

rpc_server()

rpc_server(mixed $class) : mixed
Parameters
$class : mixed

call_retry()

尝试多次运行 $times 运行次数 $usleep_time 毫秒

call_retry(mixed $func[, mixed $times = 3 ][, mixed $usleep_time = 1000 ]) : mixed
Parameters
$func : mixed
$times : mixed = 3
$usleep_time : mixed = 1000

array_to_tree()

数组转tree

array_to_tree(mixed $list[, mixed $pk = 'id' ][, mixed $pid = 'pid' ][, mixed $child = 'children' ][, mixed $root = 0 ][, mixed $my_id = '' ]) : mixed

输入$list [ {id:1,pid:0,其他字段}, {id:2,pid:1,其他字段}, {id:3,pid:1,其他字段}, ] 输出 [ [ id:1, pid:0, 其他字段, children:[ {id:2,pid:1,其他字段}, {id:3,pid:1,其他字段}, ] ] ]

Parameters
$list : mixed
$pk : mixed = 'id'
$pid : mixed = 'pid'
$child : mixed = 'children'
$root : mixed = 0
$my_id : mixed = ''

pr()

数组或字符输出,方便查看

pr(mixed $str) : mixed
Parameters
$str : mixed

add_action()

add_action(mixed $name, mixed $call[, mixed $level = 20 ]) : mixed
Parameters
$name : mixed
$call : mixed
$level : mixed = 20

do_action()

do_action(mixed $name[, mixed &$par = null ]) : mixed
Parameters
$name : mixed
$par : mixed = null

is_json()

is_json(mixed $data[, mixed $assoc = false ]) : mixed
Parameters
$data : mixed
$assoc : mixed = false

array_to_object()

array_to_object(mixed $arr) : mixed
Parameters
$arr : mixed

object_to_array()

object_to_array(mixed $obj) : mixed
Parameters
$obj : mixed

get_dir()

get_dir(mixed $name) : mixed
Parameters
$name : mixed

get_ext()

get_ext(mixed $name) : mixed
Parameters
$name : mixed

get_name()

get_name(mixed $name) : mixed
Parameters
$name : mixed

create_dir_if_not_exists()

create_dir_if_not_exists(mixed $arr) : mixed
Parameters
$arr : mixed

get_ip()

get_ip([mixed $type = 0 ][, mixed $adv = false ]) : mixed
Parameters
$type : mixed = 0
$adv : mixed = false

get_distance()

get_distance(mixed $longitude1, mixed $latitude1, mixed $longitude2, mixed $latitude2[, mixed $unit = 2 ][, mixed $decimal = 2 ]) : mixed
Parameters
$longitude1 : mixed
$latitude1 : mixed
$longitude2 : mixed
$latitude2 : mixed
$unit : mixed = 2
$decimal : mixed = 2

get_deep_dir()

get_deep_dir(mixed $path) : mixed
Parameters
$path : mixed

price_format()

price_format(mixed $yuan[, mixed $dot = 2 ]) : mixed
Parameters
$yuan : mixed
$dot : mixed = 2

json()

json([mixed $arr = [] ]) : mixed
Parameters
$arr : mixed = []

json_error()

json_error([mixed $arr = [] ][, mixed $is_array = false ]) : mixed
Parameters
$arr : mixed = []
$is_array : mixed = false

json_success()

json_success([mixed $arr = [] ][, mixed $is_array = false ]) : mixed
Parameters
$arr : mixed = []
$is_array : mixed = false

yaml_load()

yaml_load(mixed $str) : mixed
Parameters
$str : mixed

yaml_dump()

yaml_dump(mixed $array[, mixed $line = 3 ]) : mixed
Parameters
$array : mixed
$line : mixed = 3

yaml()

yaml(mixed $str) : mixed
Parameters
$str : mixed

aes_encode()

aes_encode(mixed $data[, mixed $key = '' ][, mixed $iv = '' ][, mixed $type = 'AES-128-CBC' ][, mixed $options = '' ]) : mixed
Parameters
$data : mixed
$key : mixed = ''
$iv : mixed = ''
$type : mixed = 'AES-128-CBC'
$options : mixed = ''

aes_decode()

aes_decode(mixed $data[, mixed $key = '' ][, mixed $iv = '' ][, mixed $type = 'AES-128-CBC' ][, mixed $options = '' ]) : mixed
Parameters
$data : mixed
$key : mixed = ''
$iv : mixed = ''
$type : mixed = 'AES-128-CBC'
$options : mixed = ''

string_to_array()

string_to_array(mixed $name[, mixed $array = '' ]) : mixed
Parameters
$name : mixed
$array : mixed = ''

get_dates()

get_dates(mixed $start, mixed $end[, mixed $contain_last = true ]) : mixed
Parameters
$start : mixed
$end : mixed
$contain_last : mixed = true

get_date_china()

get_date_china(mixed $date) : mixed
Parameters
$date : mixed

timeago()

timeago(mixed $time) : mixed
Parameters
$time : mixed

import()

import(mixed $file[, mixed $vars = [] ][, mixed $check_vars = false ]) : mixed
Parameters
$file : mixed
$vars : mixed = []
$check_vars : mixed = false

get_reffer()

get_reffer([mixed $refer = '' ]) : mixed
Parameters
$refer : mixed = ''

get_root_domain()

get_root_domain([mixed $host = '' ]) : mixed
Parameters
$host : mixed = ''

get_sub_domain()

get_sub_domain([mixed $host = '' ]) : mixed
Parameters
$host : mixed = ''

sign_by_secret()

sign_by_secret(mixed $params[, mixed $secret = '' ][, mixed $array_encode = false ]) : mixed
Parameters
$params : mixed
$secret : mixed = ''
$array_encode : mixed = false

zip_extract()

zip_extract(mixed $local_file, mixed $extract_local_dir) : mixed
Parameters
$local_file : mixed
$extract_local_dir : mixed

zip_create()

zip_create(mixed $local_zip_file[, mixed $files = [] ]) : mixed
Parameters
$local_zip_file : mixed
$files : mixed = []

is_json_request()

is_json_request() : mixed

array_to_el_select()

array_to_el_select(mixed $all, mixed $v, mixed $k) : mixed
Parameters
$all : mixed
$v : mixed
$k : mixed

echats()

echats(mixed $ele[, mixed $options = [] ]) : mixed
Parameters
$ele : mixed
$options : mixed = []

echats_reload()

echats_reload() : mixed

echarts()

echarts(mixed $ele[, mixed $options = [] ]) : mixed
Parameters
$ele : mixed
$options : mixed = []

echarts_reload()

echarts_reload() : mixed

set_field_allow()

设置允许字段

set_field_allow(mixed $collect, mixed $field) : mixed
Parameters
$collect : mixed
$field : mixed

get_field_allow()

获取允许字段

get_field_allow(mixed $collect) : mixed
Parameters
$collect : mixed

get_data_allow()

返回允许字段值

get_data_allow(mixed $collect, mixed $input) : mixed
Parameters
$collect : mixed
$input : mixed

think_validate()

think_validate(mixed $labels, mixed $data, mixed $rules[, mixed $show_array = false ]) : mixed
Parameters
$labels : mixed
$data : mixed
$rules : mixed
$show_array : mixed = false

validate()

validate(mixed $labels, mixed $data, mixed $rules[, mixed $show_array = false ]) : mixed
Parameters
$labels : mixed
$data : mixed
$rules : mixed
$show_array : mixed = false

jump()

jump(mixed $url) : mixed
Parameters
$url : mixed

set_url_use_cdn()

对数组添加cdn url

set_url_use_cdn(mixed &$row[, mixed $field = [] ]) : mixed
Parameters
$row : mixed
$field : mixed = []

push_task()

添加到队列 "topthink/think-queue": "^3" push_task('app\printer\job\Printer',['tt'=>11],'');

push_task(mixed $job[, mixed $data = '' ][, mixed $queue = '' ]) : mixed
Parameters
$job : mixed
$data : mixed = ''
$queue : mixed = ''

loop_tree()

向上取递归 如当前分类是3,将返回 123所有的值 $arr = loop_tree("catalog",$v['catalog_id'],true); foreach($arr as $vv){ $title[] = $vv['title']; } id pid 1 0 2 1 3 2

loop_tree(mixed $table, mixed $id[, mixed $is_frist = true ]) : mixed
Parameters
$table : mixed
$id : mixed
$is_frist : mixed = true

get_loop_tree_ids()

向下递归

get_loop_tree_ids(mixed $table, mixed $id[, mixed $where = [] ][, mixed $get_field = 'id' ]) : mixed
Parameters
$table : mixed
$id : mixed
$where : mixed = []
$get_field : mixed = 'id'

loop_del()

递归删除

loop_del(mixed $table, mixed $id[, mixed $where = [] ]) : mixed
Parameters
$table : mixed
$id : mixed
$where : mixed = []

el_table_tree()

用于tree表格排序 因为tree给的lists字段是用于显示,在排序时得到的index是不正确的, 此时需要lists_sort字段得到正确的index 在交换排序值时才能正确保存并显示

el_table_tree(mixed $list, mixed $j[, mixed $is_top = false ]) : mixed
Parameters
$list : mixed
$j : mixed
$is_top : mixed = false

el_cascader()

用于cascader字段 public function cascader(){ $catalog = db_get($this->table,"*",[ 'ORDER'=>catalog_default_order_by(), 'status'=>1 ]); $select = el_cascader(array_to_tree($catalog)); json_success(['data'=>$select]); } $catalog = db_get("catalog",[]); $select = el_cascader(array_to_tree($catalog));

el_cascader(mixed $select[, mixed $label = 'title' ][, mixed $value = 'id' ]) : mixed
Parameters
$select : mixed
$label : mixed = 'title'
$value : mixed = 'id'

_loop_del_tree()

内部实现

_loop_del_tree(mixed $table, mixed $all) : mixed
Parameters
$table : mixed
$all : mixed

_loop_tree_deep_inner()

内部实现

_loop_tree_deep_inner(mixed $all, mixed $get_field[, mixed $is_frist = false ]) : mixed
Parameters
$all : mixed
$get_field : mixed
$is_frist : mixed = false

get_xss_clean_ins()

get_xss_clean_ins() : mixed

xss_clean_str()

xss_clean_str(mixed $str) : mixed
Parameters
$str : mixed

xss_clean()

xss_clean(mixed $input) : mixed
Parameters
$input : mixed

global_trim_inner()

global_trim_inner(mixed &$in) : mixed
Parameters
$in : mixed

get()

get([mixed $key = "" ]) : mixed
Parameters
$key : mixed = ""

get_req_post()

get_req_post([mixed $key = "" ]) : mixed
Parameters
$key : mixed = ""

g()

g([mixed $key = null ]) : mixed
Parameters
$key : mixed = null

guzzle_http()

guzzle_http([mixed $click_option = [] ]) : mixed
Parameters
$click_option : mixed = []

guzzle_http_fake_option()

guzzle_http_fake_option() : mixed

get_template()

get_template(mixed $name[, mixed $replace_arr = [] ]) : mixed
Parameters
$name : mixed
$replace_arr : mixed = []

get_api_data()

获取接口请求数据,如果存在将不发起接口请求

get_api_data(mixed $title, mixed $name) : mixed
Parameters
$title : mixed
$name : mixed

api_data_insert()

记录接口请求数据

api_data_insert([mixed $data = [] ]) : mixed
Parameters
$data : mixed = []
cookie(mixed $name[, mixed $value = '' ][, mixed $expire = 0 ]) : mixed
Parameters
$name : mixed
$value : mixed = ''
$expire : mixed = 0
cookie_delete(mixed $name) : mixed
Parameters
$name : mixed

active_db()

激活数据库连接

active_db([mixed $value = 'mongo' ]) : mixed
Parameters
$value : mixed = 'mongo'

active_db_default()

使用默认monogo连接

active_db_default() : mixed

db_get_group()

group by 查寻

db_get_group(mixed $table[, mixed $field = [] ][, mixed $options = [] ][, mixed $is_pager = false ]) : mixed
Parameters
$table : mixed
$field : mixed = []
$options : mixed = []
$is_pager : mixed = false

_db_group_con()

mongodb groupby兼容

_db_group_con(mixed $k, mixed $value[, mixed $up_value = '' ]) : mixed
Parameters
$k : mixed
$value : mixed
$up_value : mixed = ''

db_set_field_type()

db_set_field_type(mixed $table, mixed $data) : mixed
Parameters
$table : mixed
$data : mixed

db_reset_data_by_filed_type()

权限字段类型设置值

db_reset_data_by_filed_type(mixed $table, mixed &$data) : mixed
Parameters
$table : mixed
$data : mixed

db_update()

数据库更新记录

db_update(mixed $table, mixed $update_data, mixed $where[, mixed $use_action = true ]) : mixed
Parameters
$table : mixed
$update_data : mixed
$where : mixed
$use_action : mixed = true

db_del()

数据库删除记录

db_del(mixed $table, mixed $where) : mixed
Parameters
$table : mixed
$where : mixed

db_insert()

向数据库添加记录

db_insert(mixed $table, mixed $data[, mixed $use_action = true ]) : mixed
Parameters
$table : mixed
$data : mixed
$use_action : mixed = true

_db_get_when_array()

内部调用,处理 where条件是数组的情况

_db_get_when_array(mixed $list, mixed $call) : mixed
Parameters
$list : mixed
$call : mixed

db_get_one()

数据库查寻

db_get_one(mixed $table, mixed $field[, mixed $call = null ]) : mixed
Parameters
$table : mixed
$field : mixed
$call : mixed = null

set_db_cache()

设置数据库查寻字段走缓存

set_db_cache(mixed $table, mixed $field) : mixed
Parameters
$table : mixed
$field : mixed

get_db_cache_key()

取缓存key

get_db_cache_key(mixed $table, mixed $where) : mixed
Parameters
$table : mixed
$where : mixed

get_db_cache_where()

取缓存where

get_db_cache_where(mixed $table, mixed $where) : mixed
Parameters
$table : mixed
$where : mixed

db_get_cache()

取数据,带缓存

db_get_cache(mixed $table[, mixed $where = [] ][, mixed $limit = null ]) : mixed
Parameters
$table : mixed
$where : mixed = []
$limit : mixed = null

db_get()

取数据

db_get(mixed $table[, mixed $field = null ][, mixed $call = null ][, mixed $limit = null ]) : mixed
Parameters
$table : mixed
$field : mixed = null
$call : mixed = null
$limit : mixed = null

db_get_count()

数量

db_get_count(mixed $table, mixed $call) : mixed
Parameters
$table : mixed
$call : mixed

db_get_sum()

计算SUM

db_get_sum(mixed $table, mixed $field, mixed $call) : mixed
Parameters
$table : mixed
$field : mixed
$call : mixed

db_pager()

数据库分页

db_pager(mixed $table[, mixed $field = [] ][, mixed $call = [] ]) : mixed
Parameters
$table : mixed
$field : mixed = []
$call : mixed = []

db_get_pager()

分页

db_get_pager(mixed $table, mixed $call) : mixed
Parameters
$table : mixed
$call : mixed

db_action()

mongodb事务

db_action(mixed $call) : mixed
Parameters
$call : mixed

mongo_action()

mongo_action(mixed $call) : mixed
Parameters
$call : mixed

db_allow()

数据库字段允许

db_allow(mixed $table, mixed $data) : mixed
Parameters
$table : mixed
$data : mixed

db_allow_set()

设置允许字段

db_allow_set(mixed $table, mixed $data) : mixed
Parameters
$table : mixed
$data : mixed

get_id_by_auto_insert()

设置或取ID

get_id_by_auto_insert(mixed $table[, mixed $data = [] ][, mixed $where = [] ][, mixed $has_time_and_update = false ]) : mixed
Parameters
$table : mixed
$data : mixed = []
$where : mixed = []
$has_time_and_update : mixed = false

get_all_or_one()

取一条或多条记录 get_all_or_one("novel_book",$where,'get_novel_book_row');

get_all_or_one(mixed $table, mixed $where[, mixed $fun = '' ][, mixed $limit = '' ]) : mixed
Parameters
$table : mixed
$where : mixed
$fun : mixed = ''
$limit : mixed = ''

set_config()

set_config(mixed $title, mixed $body) : mixed
Parameters
$title : mixed
$body : mixed

get_config()

get_config(mixed $title) : mixed
Parameters
$title : mixed

get_env()

获取ENV

get_env(mixed $key) : mixed
Parameters
$key : mixed

set_env()

设置ENV

set_env(mixed $key, mixed $val) : mixed
Parameters
$key : mixed
$val : mixed

vue_get_jidu()

季度 返回 k=>{0:开始 1:结束 flag:}

vue_get_jidu([mixed $time = '' ]) : mixed
Parameters
$time : mixed = ''

vue_get_jidu_array()

每个季度开始、结束时间

vue_get_jidu_array(mixed $year) : mixed
Parameters
$year : mixed

vue_get_last_day()

某月的最后一天

vue_get_last_day([mixed $month = '2023-07' ]) : mixed
Parameters
$month : mixed = '2023-07'

vue_message()

vue message

vue_message() : mixed

vue_loading()

loading效果

vue_loading([mixed $name = 'load' ][, mixed $txt = '加载中' ]) : mixed
Parameters
$name : mixed = 'load'
$txt : mixed = '加载中'

php_to_js()

Encodes a PHP variable into javascript representation.

php_to_js(mixed $value[, bool $safe = false ]) : string

Example:

$options=array('key1'=>true,'key2'=>123,'key3'=>'value');
echo php_to_js($options);
// The following javascript code would be generated:
// {'key1':true,'key2':123,'key3':'value'}

For highly complex data structures use and to serialize and unserialize.

If you are encoding user input, make sure $safe is set to true.

Parameters
$value : mixed

PHP variable to be encoded

$safe : bool = false

If true, 'js:' will not be allowed. In case of wrapping code with JavaScript expression will stay as is no matter what value this parameter is set to. Default is false. This parameter is available since 1.1.11.

Return values
string

the encoded string

yii_quote()

yii_quote(mixed $js[, mixed $forUrl = false ]) : mixed
Parameters
$js : mixed
$forUrl : mixed = false

Search results