摘要: 通过 innseJoin 可以将当前 model 对应的数据表和 参数带的表进行关联,(注意表名要用全称) 第一步: innerJoin('待关联的表名', '两个表中的对应相关字段') 第二步: 就可以通过 andFilterWhere() 指定相关的条件 $query->innerJoin('d 阅读全文
posted @ 2020-03-06 19:37 GetcharZp 阅读(348) 评论(0) 推荐(0)
摘要: 通过 Yii::$app->user->identity->表的字段名 可以获取登录用户的登录信息 阅读全文
posted @ 2020-03-06 15:42 GetcharZp 阅读(322) 评论(0) 推荐(0)
摘要: 通过加上 'format' => 'html' 可以是 GridView 中的列具备html标签; 例子: [ 'attribute' => 'remark', 'value' => function ($model) { return Html::a('超链接', 'https://getchar 阅读全文
posted @ 2020-03-06 13:43 GetcharZp 阅读(217) 评论(0) 推荐(0)
摘要: YII 报错: Response content must not be an array yii 在 Controller 中返回数据,要加返回数据前加下面代码: Yii::$app->response->format = Response::FORMAT_JSON; 返回的数据为 return 阅读全文
posted @ 2020-03-06 11:52 GetcharZp 阅读(363) 评论(0) 推荐(0)