版本更新了,$res=User::column('username,email');username作为键名,email作为键值,和老师说得反了
array(2) {
["imooc_1"] => string(12) "imooc_1@.com"
["imooc_2"] => string(12) "imooc_2@.com"
}
array(2) {
["imooc_1"] => string(12) "imooc_1@.com"
["imooc_2"] => string(12) "imooc_2@.com"
}
2017-11-19
我的这条修改语句对update_time没有影响
$res = User::where('id = 19')->update(['nickname'=>'huangyuxinxddd']);
这种方式就可以
$res = User::get(19);
$res->nickname = 'hahah';
$res->save();
$res = User::where('id = 19')->update(['nickname'=>'huangyuxinxddd']);
这种方式就可以
$res = User::get(19);
$res->nickname = 'hahah';
$res->save();
2017-11-19