APP_FORM_PATH
public
mixed
APP_FORM_PATH
= \VEN_ELEMENT_FORM_PATH
public
mixed
APP_FORM_PATH
= \VEN_ELEMENT_FORM_PATH
public
mixed
DS
= \DIRECTORY_SEPARATOR
public
mixed
HELPER_DIR
= __DIR__
public
mixed
IDNA_ALLOW_UNASSIGNED
= 1
public
mixed
IDNA_CHECK_BIDI
= 4
public
mixed
IDNA_CHECK_CONTEXTJ
= 8
public
mixed
IDNA_DEFAULT
= 0
public
mixed
IDNA_ERROR_BIDI
= 2048
public
mixed
IDNA_ERROR_CONTEXTJ
= 4096
public
mixed
IDNA_ERROR_DISALLOWED
= 128
public
mixed
IDNA_ERROR_DOMAIN_NAME_TOO_LONG
= 4
public
mixed
IDNA_ERROR_EMPTY_LABEL
= 1
public
mixed
IDNA_ERROR_HYPHEN_3_4
= 32
public
mixed
IDNA_ERROR_INVALID_ACE_LABEL
= 1024
public
mixed
IDNA_ERROR_LABEL_HAS_DOT
= 512
public
mixed
IDNA_ERROR_LABEL_TOO_LONG
= 2
public
mixed
IDNA_ERROR_LEADING_COMBINING_MARK
= 64
public
mixed
IDNA_ERROR_LEADING_HYPHEN
= 8
public
mixed
IDNA_ERROR_PUNYCODE
= 256
public
mixed
IDNA_ERROR_TRAILING_HYPHEN
= 16
public
mixed
IDNA_NONTRANSITIONAL_TO_ASCII
= 16
public
mixed
IDNA_NONTRANSITIONAL_TO_UNICODE
= 32
public
mixed
IDNA_USE_STD3_RULES
= 2
public
mixed
INTL_IDNA_VARIANT_2003
= 0
public
mixed
INTL_IDNA_VARIANT_UTS46
= 1
public
mixed
PHP_FLOAT_DIG
= 15
public
mixed
PHP_FLOAT_EPSILON
= 2.2204460492503E-16
public
mixed
PHP_FLOAT_MAX
= 1.7976931348623157E+308
public
mixed
PHP_FLOAT_MIN
= 2.2250738585072E-308
public
mixed
PHP_INT_MIN
= ~\PHP_INT_MAX
public
mixed
PHP_OS_FAMILY
= \Symfony\Polyfill\Php72\Php72::php_os_family()
public
mixed
PHP_VERSION_ID
= $RandomCompatversion[0] * 10000 + $RandomCompatversion[1] * 100 + $RandomCompatversion[2]
public
mixed
RANDOM_COMPAT_READ_BUFFER
= 8
public
mixed
RANDOM_COMPAT_READ_BUFFER
= 8
public
mixed
thefunpower_mongo_dir
= __DIR__
public
mixed
U_IDNA_ACE_PREFIX_ERROR
= 66564
public
mixed
U_IDNA_CHECK_BIDI_ERROR
= 66562
public
mixed
U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR
= 66568
public
mixed
U_IDNA_ERROR_LIMIT
= 66569
public
mixed
U_IDNA_ERROR_START
= 66560
public
mixed
U_IDNA_LABEL_TOO_LONG_ERROR
= 66566
public
mixed
U_IDNA_PROHIBITED_ERROR
= 66560
public
mixed
U_IDNA_STD3_ASCII_RULES_ERROR
= 66563
public
mixed
U_IDNA_UNASSIGNED_ERROR
= 66561
public
mixed
U_IDNA_VERIFICATION_ERROR
= 66565
public
mixed
U_IDNA_ZERO_LENGTH_LABEL_ERROR
= 66567
public
mixed
U_STRINGPREP_CHECK_BIDI_ERROR
= 66562
public
mixed
U_STRINGPREP_PROHIBITED_ERROR
= 66560
public
mixed
U_STRINGPREP_UNASSIGNED_ERROR
= 66561
public
mixed
VEN_ELEMENT_FORM_PATH
= __DIR__ . '/form'
判断在api接口中
in_api() : mixed
取header
get_app_header([mixed $name = '' ]) : mixed
使用header判断是app接口请求
is_app_req() : mixed
取模块、控制器、动作
get_m_c_a() : mixed
模块列表
get_module_list() : mixed
是否存在模块
has_module(mixed $name) : mixed
是否是api控制器请求
is_app_api_req() : mixed
index_url().'/scrm/site/index' 配置 index_url 如 $config['index_url'] = 'index.php';
index_url() : mixed
set_menu_group(mixed $name, mixed $arr[, mixed $level = 1 ]) : mixed
获取unipush的cid 用于推送
get_login_cid(mixed $user_id) : mixed
用openid创建帐号
create_user_by_openid(mixed $openid[, mixed $type = 'weixin' ]) : mixed
根据手机号获取帐号,如不存在支持创建帐号
get_user_by_phone(mixed $phone[, mixed $create_if_not_find = false ][, mixed $openid = '' ]) : mixed
获取手机号后设置token
set_user_token(mixed $one) : mixed
记录用户的openid
set_user_openid(mixed $openid[, mixed $data = [] ][, mixed $type = 'weixin' ]) : mixed
取用户OPENID
get_user_openid(mixed $openid[, mixed $type = 'weixin' ]) : mixed
处理用户头像、昵称
get_user_avatar_url(mixed &$user) : mixed
get_comment_status() : mixed
get_comment_status_color() : mixed
取一条评论信息
get_comment(mixed $id) : mixed
获取评论
get_comments(mixed $type[, mixed $where = [] ]) : mixed
comment row
get_comment_row(mixed &$v) : mixed
添加评论
add_comment(mixed $type[, mixed $arr = [] ][, mixed $response_json = false ]) : mixed
更新评论
update_comment(mixed $id[, mixed $where = [] ][, mixed $update_data = [] ][, mixed $response_json = false ]) : mixed
取资源信息
get_media_by_url(mixed $url) : mixed
https://image.intervention.io/v2/introduction/installation
applet_image_init() : mixed
获取提醒
get_notify(mixed $user_id, mixed $type) : mixed
已读
read_notify(mixed $user_id, mixed $type[, mixed $id = '' ]) : mixed
获取未读数量
get_notify_count(mixed $user_id, mixed $type) : mixed
添加提醒
add_notify(mixed $user_id, mixed $type, mixed $title, mixed $body[, mixed $par = [] ]) : mixed
图片缩放
applet_image_resize(mixed $url[, mixed $w = '' ][, mixed $h = '' ][, mixed $result_local = false ]) : mixed
生成二维码 content title logo name brower 其中 brower=>1时不生成文件 applet_create_qr([ 'title'=>'', 'content'=>'', 'brower'=>1, 'size'=>100, //不用CDN地址,直接返回本地相对地址 'no_cdn'=>1, ]);
applet_create_qr([mixed $arr = [] ][, mixed $dir_name = '' ]) : mixed
用户抽奖 $prize_arr = array( array('node_id'=>1,'prize'=>'平板电脑','v'=>10,'num'=>3), array('node_id'=>2,'prize'=>'数码相机','v'=>10,'num'=>1), ); $nid = 1; pr(get_rand_jp(100,$nid,$prize_arr));
get_rand_jp(mixed $user_id, mixed $nid, mixed $jp_arr) : mixed
_get_rand_jp(mixed $arr) : mixed
平分金额
get_pf_amount(mixed $amount, mixed $num) : mixed
随机金额
get_rand_amount(mixed $amount, mixed $num[, mixed $is_frist = true ]) : mixed
applet_qr_parse(mixed $input) : mixed
条形码 composer require picqer/php-barcode-generator
applet_barcode(mixed $code) : mixed
腾讯云验证码
applet_check_captch_tencent() : mixed
applet_use_captch_tencent() : mixed
VUE 验证 腾讯验证码或者图形验证码
get_phone_send_vue([mixed $opt = [] ]) : mixed
get_phone_send_form() : mixed
get_blog_status() : mixed
get_blog_status_color() : mixed
get_blog(mixed $id) : mixed
get_blog_row(mixed &$v) : mixed
get_like_pager(mixed $user_id) : mixed
是否是我喜欢的 当user_id为空,且limit>1时,返回blog被喜欢的数组
get_like_blog(mixed $blog_id[, mixed $user_id = '' ][, mixed $limit = 1 ]) : mixed
对动态点赞的会员
get_like_blog_pager(mixed $blog_id) : mixed
喜欢数量
get_like_blog_count(mixed $blog_id) : mixed
喜欢或取消喜欢
like_blog(mixed $blog_id, mixed $user_id) : mixed
关注数量
get_follow_blog_count(mixed $user_id) : mixed
就否关注
get_blog_follow_user(mixed $user_id, mixed $my_user_id) : mixed
关注
follow_blog(mixed $user_id, mixed $my_user_id) : mixed
文本+图片审核
blog_antiporn(mixed $content[, mixed $images = [] ]) : mixed
删除node
del_node(mixed $cck_name, mixed $where) : mixed
多条记录
get_nodes(mixed $cck_name, mixed $where) : mixed
一条记录
get_node(mixed $cck_name, mixed $where) : mixed
get_cck_field(mixed $cck_name) : mixed
get_cck_field_by_builder(mixed $builder) : mixed
强制更新数据
update_node(mixed $cck_name, mixed $data, mixed $where) : mixed
保存node
save_node(mixed $cck_name, mixed $input[, mixed $ret_json = false ]) : mixed
追回其他字段
get_node_more_field(mixed &$field) : mixed
数据处理
get_node_data_filter(mixed $cck_name, mixed $input) : mixed
cck分页
get_node_pager(mixed $cck_name[, mixed $where = [] ][, mixed $input = '' ]) : mixed
cck tree
get_node_tree(mixed $cck_name[, mixed $where = [] ][, mixed $input = '' ]) : mixed
node 表名 ,添加 node_
get_cck_table(mixed $cck_name) : mixed
node 表名,移除node_
remove_cck_table(mixed $cck_name) : mixed
cck init
get_init_cck(mixed $cck_name) : mixed
分页、列表统一处理where
get_node_where(mixed $builder, mixed &$where) : mixed
仅操作自己
get_cck_author_where(mixed $cck_name, mixed &$where[, mixed $auth_type = 'auth_view' ]) : mixed
$filed = form_builder_field('fn or name',$old_field); set_field_allow('scrm_customer',$field);
form_builder_field(mixed $name, mixed $old_field) : mixed
构建表单 使用 /form/builder
form_builder(mixed $name[, mixed $ret_allow_field = false ]) : mixed
form_create(mixed $arr) : mixed
builder 字段
form_field_type() : mixed
合并原字段及自定义字段
merge_form_field([mixed $field = [] ][, mixed $form = [] ]) : mixed
省市区 由命令行 php think get_city --ansi 生成
get_city_area() : mixed
同 get_city_area()
form_get_city() : mixed
think_validate https://github.com/vlucas/valitron
__(mixed $str) : mixed
缓存 加前缀 CACHE_PRE
cache([string $name = null ][, mixed $value = '' ][, mixed $options = null ][, mixed $tag = null ]) : mixed
table_sortable(mixed $id, mixed $vue_method) : mixed
host() : mixed
判断是超管
is_admin([mixed $user_id = '' ]) : mixed
判断是普通管理员
is_admin_login() : mixed
取管理员信息
get_admin_user([mixed $user_id = '' ]) : mixed
取用户信息
get_user([mixed $user_id = '' ]) : mixed
admin_header() : mixed
admin_footer() : mixed
管理员权限同步给运营
admin_access_to_yunyin([mixed $allow = [] ]) : mixed
admin_access_to_yunyin([ 'replenish', ]); add_admin_access('缺货补货.replenish',[ '查看.view', '编辑.edit', '管理.admin', 'url'=>'selling_machine/replenish' ],100);
管理员权限
admin_access(mixed $name[, mixed $user_id = '' ]) : mixed
add_admin_access(mixed $key[, mixed $array = [] ][, mixed $level = 0 ]) : mixed
get_admin_access_table() : mixed
get_admin_access() : mixed
get_admin_access_menu([mixed $user_id = '' ]) : mixed
think_vue_media_button([mixed $name = 'images' ][, mixed $top = 'form' ][, mixed $image_click = '' ]) : mixed
think_vue_media_one_button([mixed $name = 'images' ][, mixed $top = 'form' ][, mixed $show_del = false ]) : mixed
think_vue_media(mixed &$vue[, mixed $js = "this.$set(this.form,'image',v);" ][, mixed $check_js = '' ]) : mixed
app_boot() : mixed
order_num() : mixed
记录日志
insert_trace([mixed $arr = [] ][, mixed $type = 'order' ]) : mixed
获取操作记录
get_trace([mixed $type = 'order' ][, mixed $where = [] ]) : mixed
手机号显示 ****
star_phone(mixed $phone) : mixed
多图上传
vue_add_media_muit([mixed $form = 'form.images' ]) : mixed
单图上传
vue_add_media([mixed $form = 'form.images' ]) : mixed
检测RPC服务是否可用 $client = rpc_client($url); $info = $client->get_info([ 'device_id'=>'', 'device_key'=>'', ]);
rpc_server_auth() : mixed
调用远程RPC服务,如果远程的应用模块需要放在本地,可以把远程的模块复制到本项目下。 然后把数据库中对应的RPC URL删除,不需要改动其他代码,就可以不发起远程调用,而直接调用本地函数
rpc(mixed $url) : mixed
格式化数字 因mongodb对字段类型要求严格
format_money(mixed $money) : mixed
生成安全的随机密码函数
rand_password([mixed $length = 12 ]) : mixed
view
view([string $template = '' ][, mixed $vars = [] ]) : mixed
初始化RPC请求参数及Redis
common_init() : mixed
获取允许上传的mime
get_allow_mime() : mixed
文件上传 不同于图片上传,文件上传仅支持点击按钮直接上传,不支持从文件库中选择文件
file_upload_button(mixed $label[, mixed $method = 'file_upload_success' ][, mixed $accept = '' ][, mixed $is_multiple = false ][, mixed $url = '/admin/media/upload' ]) : mixed
file_upload_button('重新上传','file_upload_success','pdf')
$vue->method("file_upload_success(res, file, fileList)"," if(res.data[0]){ _this.$message.success('上传成功'); _this.form.file = res.data[0]; }else{ _this.$message.error('操作异常'); } ");
GOOGLE验证器 验证
google_authenticator(mixed $google_captcha, mixed $user) : mixed
GOOGLE验证器 生成secret
google_authenticator_create(mixed $name[, mixed $title = null ]) : mixed
记录
set_record(mixed $type[, mixed $data = [] ]) : mixed
获取记录
get_record(mixed $type[, mixed $where = [] ]) : mixed
加载 app/目录/app.php文件
load_app_php() : mixed
加载 hook/目录/hook.php文件
load_hook_php() : mixed
处理常用的主题收藏等类似操作。 是否收藏
get_node_fav_is(mixed $nid, mixed $user_id[, mixed $type = 'default' ]) : mixed
收藏列表
get_node_favs(mixed $user_id[, mixed $type = 'default' ]) : mixed
主题 收藏数量
get_node_fav_count(mixed $nid[, mixed $type = 'default' ]) : mixed
收藏或取消收藏
set_node_fav(mixed $nid, mixed $user_id[, mixed $type = 'default' ]) : mixed
get_user_tag([mixed $user_id = '' ]) : mixed
cdn_url() : mixed
设置CDN # CDN 激活 active_cdn = 1 # CDN 地址 支持以,分隔 CDN_URL = https://mac1.qihetaiji.com,https://mac.qihetaiji.com
add_cdn_url(mixed $url[, mixed $resize = '' ]) : mixed
get_admin_tag() : mixed
使用公钥加密
llc_encode(mixed $data) : mixed
pr(llc_encode([ 'url'=>'xda.icu', 'exp_title'=>'永久', 'exp_time'=>'9999-12-31', ]));
使用私钥解密 用户只保留了私钥。
llc_decode([mixed $data = '' ]) : mixed
llc_powerby() : mixed
分词
mp_jieba(mixed $text) : mixed
mp_init() : mixed
get_mp_config() : mixed
二维码 QR_SCENE 临时二维码 QR_LIMIT_SCENE永久二维码
mp_create_qr(mixed $scene_code[, mixed $action_name = 'QR_LIMIT_SCENE' ]) : mixed
获取用户基本信息(UnionID机制) https://developers.weixin.qq.com/doc/offiaccount/User_Management/Get_users_basic_information_UnionID.html#UinonId openid、subscribe、unionid、qr_scene、qr_scene_str subscribe 1已关注
mp_get_user_info(mixed $openid) : mixed
get_oauth2_wps_title(mixed $url) : mixed
get_oauth2_page_header([mixed $title = '' ]) : mixed
get_oauth2_page_footer() : mixed
publish_oauth2_img() : mixed
get_oauth2_access_token([mixed $where = [] ]) : mixed
get_oauth2_access_token_by_state([mixed $state = 'weixin:' ]) : mixed
MyXpanfileprecreate() : bool|Fileprecreateresponse
MyPcssuperfile2(mixed $uplodidTmp) : mixed
MyXpanfilecreate(mixed $uplodidTmp) : mixed
fileupload() : mixed
filemeta() : mixed
MyXpanfileimagelist() : mixed
MyXpanfiledoclist() : mixed
MyXpanfilesearch() : mixed
MyXpanfilelist() : mixed
userinfo() : mixed
MyApiQuota() : mixed
MyXpannasuinfo() : mixed
multimediafile() : mixed
MyXpanmultimediafilemetas() : mixed
MyXpanfilelistall() : mixed
auth() : mixed
MyOauthTokenAuthorizationCode() : bool|OauthTokenAuthorizationCodeResponse
MyOauthTokenRefreshToken(mixed $rToken) : mixed
MyOauthTokenDeviceCode() : mixed
MyOauthTokenDeviceToken(mixed $codeTmp) : mixed
filemanager() : mixed
MyFilemanagercopy() : mixed
MyFilemanagermove() : mixed
MyFilemanagerrename() : mixed
MyFilemanagerdelete() : mixed
composerRequire5f0a856db0eb13be86d63b013a8d9e03(string $fileIdentifier, string $file) : void
strlen() implementation that isn't brittle to mbstring.func_overload
RandomCompat_strlen(string $binary_string) : int
This version just used the default strlen()
substr() implementation that isn't brittle to mbstring.func_overload
RandomCompat_substr(string $binary_string, int $start[, int|null $length = null ]) : string
This version just uses the default substr()
(optional)
Cast to an integer if we can, safely.
RandomCompat_intval(int|float $number[, bool $fail_open = false ]) : float|int
If you pass it a float in the range (~PHP_INT_MAX, PHP_INT_MAX) (non-inclusive), it will sanely cast it to an int. If you it's equal to ~PHP_INT_MAX or PHP_INT_MAX, we let it fail as not an integer. Floats lose precision, so the <= and => operators might accidentally let a float through.
The number we want to convert to an int
Set to true to not throw an exception
We don't have any more options, so let's throw an exception right now and hope the developer won't let it fail silently.
random_bytes(mixed $length) : string
Windows with PHP < 5.3.0 will not have the function openssl_random_pseudo_bytes() available, so let's use CAPICOM to work around this deficiency.
random_bytes(int $bytes) : string
Unless open_basedir is enabled, use /dev/urandom for random numbers in accordance with best practices
random_bytes(int $bytes) : string
Why we use /dev/urandom and not /dev/random
If the libsodium PHP extension is loaded, we'll use it above any other solution.
random_bytes(int $bytes) : string
libsodium-php project:
If the libsodium PHP extension is loaded, we'll use it above any other solution.
random_bytes(int $bytes) : string
libsodium-php project:
Powered by ext/mcrypt (and thankfully NOT libmcrypt)
random_bytes(int $bytes) : string
Fetch a random integer between $min and $max inclusive
random_int(int $min, int $max) : int
Get all HTTP header key/values as an associative array for the current request.
getallheaders() : mixed
The HTTP header key/value pairs.
idn_to_ascii(mixed $domain[, mixed $options = IDNA_DEFAULT ][, mixed $variant = INTL_IDNA_VARIANT_UTS46 ][, mixed &$idna_info = array() ]) : mixed
idn_to_utf8(mixed $domain[, mixed $options = IDNA_DEFAULT ][, mixed $variant = INTL_IDNA_VARIANT_UTS46 ][, mixed &$idna_info = array() ]) : mixed
normalizer_is_normalized(mixed $input[, mixed $form = pNormalizer::NFC ]) : mixed
normalizer_normalize(mixed $input[, mixed $form = pNormalizer::NFC ]) : mixed
intdiv(mixed $num1, mixed $num2) : mixed
preg_replace_callback_array(array<string|int, mixed> $pattern, mixed $subject[, mixed $limit = -1 ][, mixed &$count = 0 ][, mixed $flags = null ]) : mixed
error_clear_last() : mixed
sapi_windows_vt100_support(mixed $stream[, mixed $enable = null ]) : mixed
stream_isatty(mixed $stream) : mixed
utf8_encode(mixed $string) : mixed
utf8_decode(mixed $string) : mixed
spl_object_id(mixed $object) : mixed
mb_ord(mixed $string[, mixed $encoding = null ]) : mixed
mb_chr(mixed $codepoint[, mixed $encoding = null ]) : mixed
mb_scrub(mixed $string[, mixed $encoding = null ]) : mixed
微信订单查寻 在订单中要调用,用户检测是否支付成功 如果需要支付宝,那么要实现 get_api_payment_alipay_query
get_api_payment_weixin_query(mixed $order_num) : mixed
微信支付退款 如果需要支付宝,那么要实现 payment_alipay_refund
payment_weixin_refund(mixed $order_num, mixed $total_fee, mixed $refund_amount[, mixed $refund_desc = '' ]) : mixed
写入支付信息
payemnt_insert_base(mixed $out_trade_no, mixed $data) : mixed
获取支付信息
get_payment_base(mixed $out_trade_no) : mixed
获取支付信息
get_payment_base_by_id(mixed $pay_id[, mixed $status = 1 ]) : mixed
更新支付信息
update_payment_base(mixed $out_trade_no, mixed $data) : mixed
写入退款信息
insert_payment_refund_info(mixed $arr) : mixed
get_webtool_wx() : mixed
add_webtool_cmd_job(mixed $cmd) : mixed
create_oss_remote_url(mixed $url) : mixed
add_oss_info(mixed $type, mixed $file, mixed $remote_url) : mixed
webtool_log(mixed $type, mixed $title, mixed $par[, mixed $is_update = false ]) : mixed
update_webtool_log(mixed $id[, mixed $data = [] ][, mixed $flag = 'ok' ]) : mixed
set_webtool_printer_finish(mixed $job_id) : mixed
close_webtool_printer_job(mixed $job_id) : mixed
get_captcha_drive() : mixed
get_captcha_check([mixed $ignore_expire = false ]) : mixed
get_captcha_init([mixed $output = true ]) : mixed
element(mixed $name, mixed $data) : mixed
element_to_str(mixed $arr) : mixed
element_vue() : mixed
element_open_pdf() : mixed
element_open_office() : mixed
redis
predis([mixed $host = '' ][, mixed $port = '' ][, mixed $auth = '' ]) : mixed
添加位置信息 predis_add_geo('places',[ [ 'lng'=>'116.397128', 'lat'=>'39.916527', 'title'=>'北京天安门' ], ]);
predis_add_geo(mixed $key[, mixed $arr = [] ]) : mixed
删除位置信息
predis_delete_geo(mixed $key[, mixed $arr = [] ]) : mixed
predis_delete_geo('places',[ '北京天安门', ]);
返回附近的地理位置 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
取lat lng
predis_geo_pos(mixed $key[, mixed $title = [] ][, mixed $to_fixed = 6 ]) : mixed
分组分页
array_to_pager(mixed $arr) : mixed
返回URL路径,不含有域名部分
get_url_remove_http(mixed $url) : mixed
取后缀 add_action("get_ext_by_url",function(&$data){ $url = $data['url']; $data['ext'] = 'pdf'; });
get_ext_by_url(mixed $url) : mixed
通过URL取mime
get_mime(mixed $url) : mixed
URL
取mime
get_mime_content(mixed $content[, mixed $just_return_ext = false ]) : mixed
文件内容,可以是通过file_get_contents取到的
获取远程URL内容
get_remote_file(mixed $url[, mixed $is_json = false ]) : mixed
移除主域名部分
remove_host(mixed $url) : mixed
下载文件 建议使用 download_file_safe
download_file(mixed $url[, mixed $contain_http = false ]) : mixed
下载资源文件到本地
download_file_safe(mixed $url[, mixed $mimes = ['image/*', 'video/*'] ][, mixed $cons = [] ][, mixed $contain_http = false ]) : mixed
下载远程文件 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
调用阿里云
curl_aliyun(mixed $url[, mixed $bodys = '' ][, mixed $method = 'POST' ]) : mixed
返回成功的json信息
success_data(mixed $data[, mixed $msg = '' ]) : mixed
返回失败的json信息
error_data(mixed $msg) : mixed
pathinfo /index.php/admin/auth/index?code=2 返回 admin/auth/index 数组时返回 ['admin','auth','index']
get_path_info([mixed $return_array = false ]) : mixed
支持pathinfo路由 未找到请用 pathinfo_not_find 函数
router_pathinfo([mixed $ns = 'app' ][, mixed $add_controller = 'controller' ][, mixed $ucfirst_controller = true ]) : mixed
生成数字随机数 一般用于核销 需要表名 rand_code 字段 nid code status默认0
make_rand_code(mixed $node_id) : mixed
核销后需要释放核销码
update_make_rand_code(mixed $node_id) : mixed
锁功能已替代 lock_call('k',functon(){
set_lock(mixed $key[, mixed $exp_time = 60 ]) : mixed
},second);
获取是否锁定
get_lock(mixed $key) : mixed
释放锁定
del_lock(mixed $key) : mixed
json数据替换
json_replace(mixed $json[, mixed $replace = [] ][, mixed $return_json = true ]) : mixed
json格式数组或数组
要替换的数组,如$replace = ['appid'=>'new appid'];
默认返回JSON格式
去除PHP代码注释
remove_php_notes(mixed $content) : mixed
在线查看office文件
online_view_office(mixed $url) : mixed
格式化输出金额 强制输出数字类型
printfs(mixed &$v[, mixed $keys = [] ][, mixed $dot = 2 ]) : mixed
float不进位,如3.145 返回3.14 进位的有默认round(3.145) 或sprintf("%.2f",3.145);
float_noup(mixed $float_number[, mixed $dot = 2 ]) : mixed
四舍五入
float_up(mixed $float_number[, mixed $dot = 2 ][, mixed $mid_val = 5 ]) : mixed
逢几进位
加载xlsx load_xls([ 'file' => $xls, 'config'=>[ '序号' =>'index', ], 'title_line'=>1, 'call'=>function($i,$row,&$d){} ]);
load_xls([mixed $new_arr = [] ]) : mixed
获取文件行数,不包空行
get_lines(mixed $file[, mixed $length = 40960 ]) : mixed
返回请求中是http还是https
get_request_top() : mixed
返回请求域名及URL部分,不包含http://
get_request_host() : mixed
自动跳转到https网站
auto_jump() : mixed
get_http_full_url(mixed $url[, mixed $fun = 'cdn_url' ]) : mixed
从数组中搜索
get_index_array_valule(mixed $array, mixed $key, mixed $val) : mixed
gbk_substr(mixed $text, mixed $start, mixed $len[, mixed $gbk = 'GBK' ]) : mixed
GBK长宽 2个字符
get_gbk_len(mixed $value[, mixed $gbk = 'GBK' ]) : mixed
文字居中
get_text_c(string $str, int $len) : mixed
文字排版 左 中 右 左 右
get_text_lr(array<string|int, mixed> $arr, int $length[, mixed $return_arr = false ]) : mixed
处理跨域
allow_cross_origin() : mixed
to_utf8(mixed $str) : mixed
csv_reader(mixed $file) : mixed
csv_writer(mixed $file[, mixed $header = [] ][, mixed $content = [] ]) : mixed
基于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(); }
开始锁
lock_start(mixed $key[, mixed $time = 1 ]) : mixed
释放锁
lock_end() : mixed
compare_date(mixed $a, mixed $b) : mixed
发布消息 redis_pub("demo","welcome man"); redis_pub("demo",['title'=>'yourname']);
redis_pub(mixed $channel, mixed $message) : mixed
取订阅消息 redis_sub("demo",function($channel,$message){ echo "channel ".$channel."\n"; print_r($message); });
redis_sub(mixed $channel, mixed $call[, mixed $unsubscribe = false ]) : mixed
send_pusher([mixed $data = [] ][, mixed $channel = 'netteadmin' ][, mixed $event = 'notice' ]) : mixed
think_check_sign(mixed $json_string[, mixed $key = '' ][, mixed $sign_key = 'sign' ]) : mixed
think_create_sign([mixed $arr = [] ][, mixed $key = '' ]) : mixed
get_str_ord(mixed $str[, mixed $is_join = false ]) : mixed
gz_encode(mixed $arr_or_str) : mixed
gz_decode(mixed $str) : mixed
html_to_pdf(mixed $input_html_file, mixed $output_pdf_file[, mixed $return_cmd = false ][, mixed $exec = false ]) : mixed
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
text_add_br(mixed $text, mixed $w[, mixed $br = '<br>' ]) : mixed
get_server_headers([mixed $name = '' ]) : mixed
output_js_css([mixed $js = '' ][, mixed $css = '' ]) : mixed
解析文件内容
file_parse(mixed $file[, mixed $zip_output_dir = '' ][, mixed $need_remove = false ]) : mixed
支持 zip pdf xml pdf读取 yum install poppler-utils odf转pdf pip install mupdf
file_parse(DIR.'/1.zip',DIR."/tmp"); file_parse(DIR.'/2.xml',DIR);
优化数量显示 1.10显示为1.1 1.05显示为1.05 1.00显示为1
show_number(mixed $num) : mixed
取字符中的数字
get_str_number(mixed $input) : mixed
贝塞尔
line_bezier([mixed $opt = [] ][, mixed $return = 'base64' ]) : mixed
blob | base64 当为blob时 header("Content-Type: image/png");echo $blob;exit; 当为base64时 echo "";
数字转中文,非金额读法
num_to_chinese(mixed $num) : mixed
获取本地音视频时长 https://github.com/JamesHeinrich/getID3 composer require james-heinrich/getid3
get_video_time(mixed $video_local_path[, mixed $ret_time = true ]) : mixed
目录 复制到 另一个目录
copy_dir(mixed $source, mixed $dest) : mixed
解压zip、7z、gz、tar、bz2包 yum -y install p7zip unar unzip
unzip_tar(mixed $input[, mixed $output_base = '' ]) : mixed
exec
think_exec(mixed $cmd[, mixed &$output = '' ][, mixed $show_err = false ]) : mixed
xml2array(mixed $xml_content) : mixed
_xml2array_node(mixed $node) : mixed
array2xml(mixed $arr[, mixed $root = '' ]) : mixed
是否是图片
is_image_ext(mixed $url) : mixed
是否是视频
is_video_ext(mixed $url) : mixed
是否是音频
is_audio_ext(mixed $url) : mixed
copy_base64_data() : mixed
set_scss_path(mixed $path) : mixed
scss(mixed $css[, mixed $is_cached = false ]) : mixed
HTML端收消息 wss://yourdomain/wss ws://ip:port
get_ws_js(mixed $func[, mixed $ws = 'ws://127.0.0.1:3006' ]) : mixed
生成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
xis_ssl() : mixed
xcookie(mixed $name[, mixed $value = '' ][, mixed $expire = 0 ]) : mixed
xcookie_delete(mixed $name) : mixed
rpc_client(mixed $url[, mixed $is_remote = false ]) : mixed
rpc_server(mixed $class) : mixed
rpc_token() : mixed
尝试多次运行 $times 运行次数 $usleep_time 毫秒
call_retry(mixed $func[, mixed $times = 3 ][, mixed $usleep_time = 1000 ]) : mixed
数组转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,其他字段}, ] ] ]
数组或字符输出,方便查看
pr(mixed $str) : mixed
add_action(mixed $name, mixed $call[, mixed $level = 20 ]) : mixed
do_action(mixed $name[, mixed &$par = null ]) : mixed
is_cli() : mixed
is_post() : mixed
is_json(mixed $data[, mixed $assoc = false ]) : mixed
array_to_object(mixed $arr) : mixed
object_to_array(mixed $obj) : mixed
get_dir(mixed $name) : mixed
get_ext(mixed $name) : mixed
get_name(mixed $name) : mixed
create_dir_if_not_exists(mixed $arr) : mixed
is_local() : mixed
get_ip([mixed $type = 0 ][, mixed $adv = false ]) : mixed
now() : mixed
get_distance(mixed $longitude1, mixed $latitude1, mixed $longitude2, mixed $latitude2[, mixed $unit = 2 ][, mixed $decimal = 2 ]) : mixed
get_deep_dir(mixed $path) : mixed
price_format(mixed $yuan[, mixed $dot = 2 ]) : mixed
json([mixed $arr = [] ]) : mixed
json_error([mixed $arr = [] ][, mixed $is_array = false ]) : mixed
json_success([mixed $arr = [] ][, mixed $is_array = false ]) : mixed
yaml_load(mixed $str) : mixed
yaml_dump(mixed $array[, mixed $line = 3 ]) : mixed
yaml(mixed $str) : mixed
aes_encode(mixed $data[, mixed $key = '' ][, mixed $iv = '' ][, mixed $type = 'AES-128-CBC' ][, mixed $options = '' ]) : mixed
aes_decode(mixed $data[, mixed $key = '' ][, mixed $iv = '' ][, mixed $type = 'AES-128-CBC' ][, mixed $options = '' ]) : mixed
string_to_array(mixed $name[, mixed $array = '' ]) : mixed
get_dates(mixed $start, mixed $end[, mixed $contain_last = true ]) : mixed
get_date_china(mixed $date) : mixed
timeago(mixed $time) : mixed
is_ajax() : mixed
import(mixed $file[, mixed $vars = [] ][, mixed $check_vars = false ]) : mixed
get_reffer([mixed $refer = '' ]) : mixed
get_root_domain([mixed $host = '' ]) : mixed
get_sub_domain([mixed $host = '' ]) : mixed
sign_by_secret(mixed $params[, mixed $secret = '' ][, mixed $array_encode = false ]) : mixed
zip_extract(mixed $local_file, mixed $extract_local_dir) : mixed
zip_create(mixed $local_zip_file[, mixed $files = [] ]) : mixed
is_json_request() : mixed
array_to_el_select(mixed $all, mixed $v, mixed $k) : mixed
echats(mixed $ele[, mixed $options = [] ]) : mixed
echats_reload() : mixed
echarts(mixed $ele[, mixed $options = [] ]) : mixed
echarts_reload() : mixed
设置允许字段
set_field_allow(mixed $collect, mixed $field) : mixed
获取允许字段
get_field_allow(mixed $collect) : mixed
返回允许字段值
get_data_allow(mixed $collect, mixed $input) : mixed
is_ssl() : mixed
think_validate(mixed $labels, mixed $data, mixed $rules[, mixed $show_array = false ]) : mixed
validate(mixed $labels, mixed $data, mixed $rules[, mixed $show_array = false ]) : mixed
jump(mixed $url) : mixed
对数组添加cdn url
set_url_use_cdn(mixed &$row[, mixed $field = [] ]) : mixed
添加到队列 "topthink/think-queue": "^3" push_task('app\printer\job\Printer',['tt'=>11],'');
push_task(mixed $job[, mixed $data = '' ][, mixed $queue = '' ]) : 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
loop_tree(mixed $table, mixed $id[, mixed $is_frist = true ]) : mixed
向下递归
get_loop_tree_ids(mixed $table, mixed $id[, mixed $where = [] ][, mixed $get_field = 'id' ]) : mixed
递归删除
loop_del(mixed $table, mixed $id[, mixed $where = [] ]) : mixed
用于tree表格排序 因为tree给的lists字段是用于显示,在排序时得到的index是不正确的, 此时需要lists_sort字段得到正确的index 在交换排序值时才能正确保存并显示
el_table_tree(mixed $list, mixed $j[, mixed $is_top = false ]) : 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));
el_cascader(mixed $select[, mixed $label = 'title' ][, mixed $value = 'id' ]) : mixed
内部实现
_loop_del_tree(mixed $table, mixed $all) : mixed
内部实现
_loop_tree_deep_inner(mixed $all, mixed $get_field[, mixed $is_frist = false ]) : mixed
get_xss_clean_ins() : mixed
xss_clean_str(mixed $str) : mixed
xss_clean(mixed $input) : mixed
global_trim() : mixed
global_trim_inner(mixed &$in) : mixed
get([mixed $key = "" ]) : mixed
get_req_post([mixed $key = "" ]) : mixed
g([mixed $key = null ]) : mixed
get_input() : mixed
guzzle_http([mixed $click_option = [] ]) : mixed
guzzle_http_fake_option() : mixed
get_template(mixed $name[, mixed $replace_arr = [] ]) : mixed
获取接口请求数据,如果存在将不发起接口请求
get_api_data(mixed $title, mixed $name) : mixed
记录接口请求数据
api_data_insert([mixed $data = [] ]) : mixed
cookie(mixed $name[, mixed $value = '' ][, mixed $expire = 0 ]) : mixed
cookie_delete(mixed $name) : mixed
获取ENV
get_env(mixed $key) : mixed
设置ENV
set_env(mixed $key, mixed $val) : mixed
set_config(mixed $title, mixed $body) : mixed
get_config(mixed $title) : mixed
设置或取ID
get_id_by_auto_insert(mixed $table[, mixed $data = [] ][, mixed $where = [] ][, mixed $has_time_and_update = false ]) : mixed
取一条或多条记录 get_all_or_one("novel_book",$where,'get_novel_book_row');
get_all_or_one(mixed $table, mixed $where[, mixed $fun = '' ][, mixed $limit = '' ]) : mixed
db_set_field_type(mixed $table, mixed $data) : mixed
权限字段类型设置值
db_reset_data_by_filed_type(mixed $table, mixed &$data) : mixed
激活数据库连接
db_active([mixed $value = 'mongo' ]) : mixed
使用默认monogo连接
db_active_default() : mixed
group by 查寻
db_get_group(mixed $table[, mixed $field = [] ][, mixed $options = [] ][, mixed $is_pager = false ]) : mixed
mongodb groupby兼容
_db_group_con(mixed $k, mixed $value[, mixed $up_value = '' ]) : mixed
数据库更新记录
db_update(mixed $table, mixed $update_data, mixed $where[, mixed $use_action = true ]) : mixed
数据库删除记录
db_del(mixed $table, mixed $where) : mixed
向数据库添加记录
db_insert(mixed $table, mixed $data[, mixed $use_action = true ]) : mixed
内部调用,处理 where条件是数组的情况
_db_get_when_array(mixed $list, mixed $call) : mixed
数据库查寻
db_get_one(mixed $table, mixed $field[, mixed $call = null ]) : mixed
设置数据库查寻字段走缓存
set_db_cache(mixed $table, mixed $field) : mixed
取缓存key
get_db_cache_key(mixed $table, mixed $where) : mixed
取缓存where
get_db_cache_where(mixed $table, mixed $where) : mixed
取数据,带缓存
db_get_cache(mixed $table[, mixed $where = [] ][, mixed $limit = null ]) : mixed
取数据
db_get(mixed $table[, mixed $field = null ][, mixed $call = null ][, mixed $limit = null ]) : mixed
数量
db_get_count(mixed $table, mixed $call) : mixed
计算SUM
db_get_sum(mixed $table, mixed $field, mixed $call) : mixed
数据库分页
db_pager(mixed $table[, mixed $field = [] ][, mixed $call = [] ]) : mixed
分页
db_get_pager(mixed $table, mixed $call) : mixed
mongodb事务
db_action(mixed $call) : mixed
mongo_action(mixed $call) : mixed
数据库字段允许
db_allow(mixed $table, mixed $data) : mixed
设置允许字段
db_allow_set(mixed $table, mixed $data) : mixed
季度 返回 k=>{0:开始 1:结束 flag:}
vue_get_jidu([mixed $time = '' ]) : mixed
每个季度开始、结束时间
vue_get_jidu_array(mixed $year) : mixed
某月的最后一天
vue_get_last_day([mixed $month = '2023-07' ]) : mixed
vue message
vue_message() : mixed
loading效果
vue_loading([mixed $name = 'load' ][, mixed $txt = '加载中' ]) : mixed
<el-table class="draggable_video"></el-table>
vue_el_table_drag([mixed $ele = '.table' ][, mixed $data = 'form.video_list' ]) : mixed
$str = vue_el_table_drag($ele='.draggable_video',$data='form.video_list'); $vue->method("video_row_drop(ele)",$str); 表格拖拽
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.
PHP variable to be encoded
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.
the encoded string
yii_quote(mixed $js[, mixed $forUrl = false ]) : mixed