<?php /** * Created by PhpStorm. * User: xiaofeng * Date: 2018/3/4 * Time: 上午9:25 */ namespace common\models; class Synchouserecord extends Common { // public static function primaryKey() // { //// return 'own_hid'; // } public function behaviors() { return []; } public function getLerifyHouse($h_unid) { $housecord = self::find()->select(['own_hid as hid'])->where(['unid' => $h_unid])->asArray()->one(); return $housecord; if (!empty($housecord)) { return \common\models\House::find()->select(['id as hid', 'city'])->where(['id' => $housecord['hid']])->asArray()->one(); } else { return null; } } }