![](https://img-blog.csdnimg.cn/2019092715111047.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
yii2 相关知识
yii2 相关知识
生活有亮
知足常乐
展开
-
php 有些接口数据量太大,导致访问超时
有些循环数据量大的表,接口会出错,在方法的里面加上这个。原创 2022-12-01 16:06:26 · 635 阅读 · 0 评论 -
yii sql 将datetime格式转换成 年月日 和年月
转换成日期格式 :在field里面写 date(create_time) as time 或者 date_format(create_time,"%Y-%m-%d") as time转换成年 -月格式 :在field里面写 date_format(create_time,"%Y-%m") as time原创 2022-03-16 11:42:39 · 1187 阅读 · 0 评论 -
yii2 报错Getting unknown property:common\models\User::status
在 方法:在common/models/user.php中class下添加如下:public $status;原创 2021-08-17 20:13:18 · 1189 阅读 · 4 评论 -
配置一个Yii2.0 + vue的本地后台项目
PHP:拉下代码之后 现将vendor文件添加到项目根目录编辑器打开项目 PHP init 初始化项目在宝塔面板中配置域名信息(1)根目录是否正确 选择对应的PHP版本(2)取消跨站攻击(3)配置伪静态在C:\Windows\System32\drivers\etc\hosts 文件中添加对应的域名VUE:拉下代码 在vue.comfig.js 文件修改访问的PHP路径 config文件夹下index.js 里面的路径打开命令行 cnpm install cor原创 2021-06-29 11:42:25 · 912 阅读 · 1 评论 -
YII2.0实现浏览量+1
上代码:$count = 1;//实现+1$count = -1;//实现-1 News::updateAllCounters(['reading' => $count],['id' => $id['id']]);好了原创 2020-10-30 09:36:16 · 403 阅读 · 0 评论 -
Yii2 + 阿里云 后台配置发送短信
1.登录阿里云账号之后 首先鼠标移动到你的头像上 点击AccessKey之后 创建2.找到短信服务这里 申请签名 和 模板3.登录yii2框架后台填写上相对应的信息。4.在控制器中: public function actionIndex() { $phone=Yii::$app->request->get('phone'); $code = rand(100000,999999); Yii::$app->session-&原创 2020-06-15 16:34:21 · 588 阅读 · 0 评论 -
yii2 安装报错:Could not open input file: composer.phar
再根据官方文档进行安装依赖的时候:php composer.phar install出现错误:Could not open file: composer.phar我们执行下面代码:php -r "readfile('https://getcomposer.org/installer');" | php然后在执行:php composer.phar install然后我的就好了,如果不对,请继续百度。...原创 2020-06-11 09:40:25 · 1885 阅读 · 0 评论 -
yii2 提示Invalid argument supplied for foreach() 等错误
Yii 提示Invalid argument supplied for foreach() 或者 undefined variable: val等错误:1.只需要在对应的文件中加入error_reporting(0);就可以了2.在入口index.php中添加也是可以的。原创 2020-06-05 17:28:51 · 802 阅读 · 2 评论 -
yii2.0 增删改查sql语句
文章涉及where、 addParams 、filterWhere 、andWhere、orWhere、 andFilterWhere()、 orFilterWhere()、andFilterCompare()但是格式是一样的。字符串格式’status=1’哈希格式’status’ => 1, ‘type’ => 2]操作符格式’like’, ‘name’, ‘test’]字符串和哈希格式很好理解,我们来看看操作符格式,因为操作符格式可以组成相对复杂的查询语句最简单的就是官方给的例子原创 2020-06-03 15:50:50 · 1029 阅读 · 0 评论