thinkphp6

thinkphp6的join连表查询

说明 join 要关联的(完整)表名以及别名,支持三种写法: 写法1:[ '完整表名或者子查询'=>'别名' ] 写法2:'完整表名 别名' 写法3:'不带数据表前缀的表名' condition 关联条件,可以为字符串或数组, 为数组时每一个元素都是一个关联条件。 type 关联类型,可以为: IN ......
thinkphp6 thinkphp join

ThinkPHP6的跳转案例

` // 在控制器中的某个方法中进行跳转并传递参数 public function redirectToPageWithParams() { $params = [ 'param1' => 'value1', 'param2' => 'value2', ]; // 使用 $this->redirec ......
ThinkPHP6 ThinkPHP 案例

ThinkPHP6 关于事件的简单应用

一、序章 ThinkPHP6的手册中关于【事件】章节的介绍都是直接文字说明,给出创建的类文件,并没有一个好的示例来进行补充说明。对于刚接触【事件】的同学在阅读理解上增加了一点点困难,本文就在此结合示例简单叙述下。 二、事件 事件的使用分两种方式,一个是不使用事件类,另一个使用事件类。 1、不使用事件 ......
ThinkPHP6 ThinkPHP 事件

ThinkPHP6.x 使用指南

PHP 版本:PHP 8.1.0 框架版本:ThinkPHP 6 编辑工具:PHPStorm 2021.3.3 系统环境:Windows 10 0x01 概述 (1)简介 ThinkPHP 框架简称 TP 框架 TP 框架是免费开源的、轻量级的、简单快速且敏捷的 PHP 框架 可以免费使用 TP 框 ......
使用指南 ThinkPHP6 ThinkPHP 指南

ThinkPHP6学习笔记2

### 门面模式 facade ### facade 不能在模型里面建立关联关系: 这里是属于注入是不能使用facade类的 ### Facade 怎么获取model实例对象 ``` - facede instance方法 $model = TestFacadeModel::instance(); ......
ThinkPHP6 ThinkPHP 笔记

thinkphp: thinkphp6升级到thinkphp8(8.0.1)

一,官方文档: https://doc.thinkphp.cn/v8_0/setup.html 二,查看当前的php版本是否满足升级条件: 1,文档中的环境要求 2,查看本地的php版本: liuhongdi@lhdpc:~$ /usr/local/soft/php8/bin/php --versi ......
thinkphp thinkphp6 thinkphp8

vue.js:canvas作为文件上传到后端(vue.js3/thinkphp6)

一,前端代码: 说明:前端使用vue.js3+axios,主要通过canvas.toBlob这个api实现canvas转文件上传 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3 ......
vue thinkphp6 thinkphp 文件 canvas

thinkphp6 nginx配置

server { listen 88; server_name localhost; root /www/tp/public; index index.php index.html index.htm; charset utf-8; location / { if (!-e $request_fil ......
thinkphp6 thinkphp nginx

Thinkphp6 连接达梦数据库

## Thinkphp6 连接达梦数据库 这里使用 IDEA phpEnv PHP7.3 Thinkphp6 桌面操作系统:Windows11 虚拟机:VMware 服务器操作系统:银河麒麟 在虚拟机操作与windows无异 [参考资料](https://blog.csdn.net/chenxuan ......
Thinkphp6 Thinkphp 数据库 数据

ThinkPHP6.0 链式SQL语句

## ThinkPHP6.0 链式SQL语句 #### 查询单个数据 ```php $user = Db::query('select * from `user`'); $user=Db::table('user')->where('UserID',1001)->find();//查询结果为空 返回 ......
语句 ThinkPHP6 ThinkPHP SQL

thinkphp6多用用模式下缩短路由

场景描述:要做seo,要缩短路由。原xxx.com/home/article/1改为xxx.com/article/1 解决办法:index.php <?php // + // | ThinkPHP [ WE CAN DO IT JUST THINK ] // + // | Copyright (c ......
多用用 路由 thinkphp6 thinkphp 模式

thinkphp6:使用view视图/模板(thinkphp v6.0.12LTS)

一,在使用之前,需要用composer安装需要的view模块: 参见: https://blog.imgtouch.com/index.php/2023/06/29/thinkphp6-bao-cuo-driver-think-not-supported/ 二,php代码: <?php declar ......
thinkphp 视图 thinkphp6 模板 0.12

thinkphp6:报错:Driver [Think] not supported

一,报错信息: { code:422, msg:"Driver [Think] not supported.", data:"" } 如图: 问题的原因:使用view这个类但相应的库未安装 二,解决: 安装topthink/think-view这个库即可 [lhdop@blog tpapibase] ......
thinkphp6 supported thinkphp Driver Think

thinkphp6数据库相关操作

一、多表联合查询 $list = UserModel::where(function (Query $query) { $data = $this->request->param(); $query->where('user_type',2); 。。。。 })->haswhere('UserPara ......
thinkphp6 thinkphp 数据库 数据

thinkphp6 获取刚入库的数据ID方法

首先,插入数据,有3个方法都可以实现 create() create方法返回当前模型的对象实例,用箭头符号就能获取主键ID 如果你的自增ID是id的话,获取方法也要变成 $order->id $order = order::create($data); echo $order->id; save() ......
thinkphp6 thinkphp 方法 数据

Thinkphp6 自定义命令创建类文件

以创建控制器为例 1、先通过 think 命令创建一个make文件,效果如下图: php think make:command make/MyController 2、修改上面创建的文件【MyController.php】 <?php declare (strict_types = 1); name ......
Thinkphp6 Thinkphp 命令 文件

crontab + ThinkPHP6 配合使用

crontab + ThinkPHP6 配合使用 1:命令行 执行 php think make:command Hello hello php think make:command 控制器名 方法名 2:console 配置 3:测试执行 php think hello 控制台得到结果hello ......
ThinkPHP6 ThinkPHP crontab
共17篇  :1/1页 首页上一页1下一页尾页