冯叙澎
- 冯叙澎 赞了回答
第一个问题:
可以使用andWhere()
追加查询条件。使用方法:$query = Post::find(); $query->where(['category' => $category]); $query->andWhere(['type' => $type]);
第二个问题:
时间的插入一般是在beforeSave()
中写入的。使用方法如下:public function beforeSave($insert) { if (parent::beforeSave($insert)) { if($insert) { $this->user_id = Yii::$app->user->id; $this->created_at = $this->updated_at = time(); } else { $this->updated_at = time(); } return true; } else { return false; } }
支持字段复制么 ?
- 冯叙澎 回答了问题 关于hasOne和hasMany查询问题请教以下
不调用不占用资源吧; 跟数组不太一样
- 冯叙澎 回答了问题 Yii2.0关于mysql转oracle
源码从mysql迁移到了oracle ?
- 冯叙澎 回答了问题 yii2的model能做互换表中两列数据吗
为什么不用createCommand($sql); ?
设置成什么样子 ?
- 冯叙澎 发表了说说hello everyone !