03 2020 档案
摘要:案例: $country = new Country; $country->code = "AB"; $country->name = "name"; $country->population = 123; var_dump($country->save()); var_dump($country-
阅读全文
摘要:springboot 使用 DigestUtils 工具栏对进行数据加密 String md5 = DigestUtils.md5DigestAsHex("123456".getBytes()); System.out.println(md5);
阅读全文
摘要:通过 innseJoin 可以将当前 model 对应的数据表和 参数带的表进行关联,(注意表名要用全称) 第一步: innerJoin('待关联的表名', '两个表中的对应相关字段') 第二步: 就可以通过 andFilterWhere() 指定相关的条件 $query->innerJoin('d
阅读全文
摘要:通过 Yii::$app->user->identity->表的字段名 可以获取登录用户的登录信息
阅读全文
摘要:通过加上 'format' => 'html' 可以是 GridView 中的列具备html标签; 例子: [ 'attribute' => 'remark', 'value' => function ($model) { return Html::a('超链接', 'https://getchar
阅读全文
摘要:YII 报错: Response content must not be an array yii 在 Controller 中返回数据,要加返回数据前加下面代码: Yii::$app->response->format = Response::FORMAT_JSON; 返回的数据为 return
阅读全文
摘要:第一步:通过 gii 生成 CRUD 的代码 第二步:修改该视图所对应的 model 中的 attributeLabels 函数 public function attributeLabels() { return [ 'id' => 'ID', 'order_id' => '订单 ID', //
阅读全文
摘要:修改 maven/conf/settings.xml 文件 中的 mirror <mirrors> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/grou
阅读全文