'int', 'title' => 'string', 'status' => 'tinyint', 'priority' => 'int' ]; public function getStatusTextAttr($value,$data) { $status = [1=>'显示', 2=>'隐藏']; return $status[$data['status']]; } public function getIntegralTextAttr($value,$data) { return 0; } // 关联MallGoods public function mallGoods() { return $this->hasMany(MallGoods::class, "cateid", "id"); } }