Yii2框架查询指定字段和获取添加数据的id
作者:互联网
指定字段:
$historyinfo = Healthy::find()->select(['healthy_id','pet_name','hardware_name','hardware_color','remove_binding'])->where(['user_id'=>$user_id,'is_activation'=>'2'])->asArray()->all();
获取添加数据的id:
$id = $model->attributes['healthy_id']; 如果不行 那就用如下这个标签:name,healthy,hardware,字段,添加,user,Yii2,id 来源: https://www.cnblogs.com/huanglei559/p/10993681.html