首页 > 其他 > 详细

yii2连表查询

时间:2018-11-05 13:14:15      阅读:180      评论:0      收藏:0      [点我收藏+]
$list = Setting::find()->alias(‘s‘)
            ->where([‘s.store_id‘ => $this->store_id])
            ->leftJoin(‘{{%qrcode}} q‘, ‘q.store_id=s.store_id and q.is_delete=0‘)
            ->select([‘s.level‘, ‘q.qrcode_bg‘])
            ->asArray()->one();

  

yii2连表查询

原文:https://www.cnblogs.com/liju/p/9908536.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!