hasOne('ResourceCategory', 'id', 'cid'); } /** * @Notes: 关联资源分类模型 * @Author: */ public function category2() { return $this->hasOne('ResourceCategory', 'id', 'cid2'); } }