hasOne关联查询 [ 2.0 版本 ]
使用hasOne查询,打印出来的数据如下。
object(yii\db\ActiveQuery)#117 (28) { ["sql"]=> NULL ["on"]=> NULL ["joinWith"]=> NULL ["select"]=> NULL ["selectOption"]=> NULL ["distinct"]=> NULL ["from"]=> NULL ["groupBy"]=> NULL ["join"]=> NULL ["having"]=> NULL ["union"]=> NULL ["params"]=> array(0) { } ["_events":"yii\base\Component":private]=> array(0) { } ["_behaviors":"yii\base\Component":private]=> array(0) { } ["where"]=> NULL ["limit"]=> NULL ["offset"]=> NULL ["orderBy"]=> NULL ["indexBy"]=> NULL ["emulateExecution"]=> bool(false) ["modelClass"]=> string(21) "backend\models\Access" ["with"]=> NULL ["asArray"]=> NULL ["multiple"]=> bool(false) ["primaryModel"]=> object(backend\models\Menu)#99 (8) { ["_attributes":"yii\db\BaseActiveRecord":private]=> array(0) { } ["_oldAttributes":"yii\db\BaseActiveRecord":private]=> NULL ["_related":"yii\db\BaseActiveRecord":private]=> array(0) { } ["_errors":"yii\base\Model":private]=> NULL ["_validators":"yii\base\Model":private]=> NULL ["_scenario":"yii\base\Model":private]=> string(7) "default" ["_events":"yii\base\Component":private]=> array(0) { } ["_behaviors":"yii\base\Component":private]=> array(0) { } } ["link"]=> array(1) { ["url"]=> string(9) "rule_name" } ["via"]=> NULL ["inverseOf"]=> NULL }
共 1 个回答
pengcx 鹭岛
最后登录:2022-11-08
在线时长:100小时57分
- 粉丝1
- 金钱17010
- 威望10
- 积分18110