yii2连表查询

$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();

  

posted @ 2018-11-05 12:49  lijun_a  阅读(1291)  评论(0编辑  收藏  举报