php
HjmaAsC
LNMP,thinkphp6 + swoole + uni-app + vue-admin 前后端全栈开发
展开
-
nginx rtmp thinkphp6权限控制
参考:Directives · arut/nginx-rtmp-module Wiki · GitHub文档中描述了可以添加事件 on_connect on_play on_publish on_done on_play_done on_publish_done on_record_done on_update notify_update_timeout notify_update_strict notify_rela原创 2021-03-27 21:34:29 · 222 阅读 · 0 评论 -
thinkphp6的路由与vue前端结合时控制器的注意事项
方式1:如果路由写如下:Route::get('user/:mer_id', 'api.Auth/userInfo');前端应该这样写export function getUserInfo(mer_id) { return request.get('user/' + mer_id)}方式二:如果路由这样写Route::get('user', 'api.Auth/userInfo');控制器这样写public function userInfo($mer_id) { .原创 2021-03-12 19:16:13 · 455 阅读 · 0 评论 -
PHP版服务器端支付宝身份认证文档的坑
根据官方说明,PHP的参数如下$bizContent = "{" ."\"outer_order_no\":\"ZGYD201809132323000001234\"," ."\"biz_code\":\"FACE\"," ."\"identity_param\":\"{\\\"identity_type\\\":\\\"CERT_INFO\\\",\\\"cert_type\\\":\\\"IDENTITY_CARD\\\",\\\"cert_name\\\":\\\"收委\\\",\\\"cer原创 2021-03-09 10:56:06 · 504 阅读 · 0 评论 -
Composer无法升级包locked at问题的解决
在CRMEB项目上,想安装新的包,运行:composer require yansongda/pay -vvv出现提示Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package overtrue/wechat (locked at 3.3.33, required as ^4.2.33) is satisfiable by ove原创 2021-02-18 20:03:17 · 1373 阅读 · 0 评论 -
thinkphp Swoole 8686 Operation not permitted
在使用supervisord服务时,如果是把thinkphp swoole先添加启动配置文件/etc/supervisord.d/mySwoole.ini:[program:sw_mi]command=php think swoole restartdirectory=/var/www/mi/autorestart=truestartsecs=3startretries=3stdout_logfile=/var/log/wwwSwoole/sw_mi.out.logstderr_logfil原创 2021-02-13 23:41:38 · 307 阅读 · 0 评论 -
Centos7安装phpMyAdmin(nginx+php-fpm)
升级系统sudo yum update -y安装高版本的nginx参考:Install nginx 1.8 on Centos 7wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpmrpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpmyum install nginx安装高版本的mysql安装步骤参考原创 2021-02-13 13:33:41 · 772 阅读 · 0 评论 -
think migrate自增字段与复合主键的使用方法
使用 thinkphp数据库迁移工具,建表时,默认产生id字段,并且是自增的,但是为了很多情况下,需要不创建自增字段,可以使用下面的语句,也可以创建复合主键(多个字段的复合主键) public function change() { // 这段语不生成ID字段,但是新加的字段不会自增 $table = $this->table('test', ['id' => false, 'primary_key' => ['test_id', 'follo原创 2021-01-31 15:48:13 · 681 阅读 · 3 评论 -
PHP explode函数的BUG
如果分割字符串是“0”,结果不是[“0”],而是[]这是bug吧?原创 2020-10-12 00:03:37 · 208 阅读 · 0 评论 -
PHP使用枚举类型(极简版)
混有ThinkPHP的代码class EnumBase { protected $value; public function __construct($value) { $this->value = $value; } public function __toString() { return (string)$this->value; }}class RelationEnum extends原创 2020-09-05 12:52:01 · 2361 阅读 · 0 评论 -
调试CRME后台的SQL语句(ThinkPHP6)
问题描述写代码肯定有失误的时候,当查询参数出错时,如何输出错误信息呢?以前用thinkphp5在报错误的时候,可以通过DB::select(false)直接返回错误脚本,但是现在不可以了,会抛出异常,这样如何处理呢?解决办法代码是CRMEB下的,使用Dao进行处理<?phpnamespace app\common\dao\store;use app\common\dao\BaseDao;use app\common\model\store\StoreCategory as model;原创 2020-07-25 18:57:50 · 965 阅读 · 0 评论 -
使用php的crul函数进行上传
<?php$target_url = "http://服务器";$file_name_with_full_path = "本地文件路径/var/www/......";if (function_exists('curl_file_create')) { // php 5.5+ $cFile = curl_file_create($file_name_with_full_path);} else { // $cFile = '@' . realpath($file_name_wi原创 2020-05-23 22:25:13 · 167 阅读 · 0 评论