30 lines
724 B
PHP
30 lines
724 B
PHP
|
|
<?php
|
|||
|
|
|
|||
|
|
namespace App\Models\business;
|
|||
|
|
|
|||
|
|
use App\BaseApp\BaseBusinessModel;
|
|||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|||
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 工厂管理(cc_factory_info)
|
|||
|
|
*
|
|||
|
|
* 外键列名就叫 classification(不是 classification_id),沿用老表不改。
|
|||
|
|
*/
|
|||
|
|
class FactoryInfoModel extends BaseBusinessModel
|
|||
|
|
{
|
|||
|
|
protected $table = 'factory_info';
|
|||
|
|
|
|||
|
|
protected $guarded = [];
|
|||
|
|
|
|||
|
|
public function classificationInfo(): BelongsTo
|
|||
|
|
{
|
|||
|
|
return $this->belongsTo(FactoryClassificationModel::class, 'classification', 'id');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public function images(): HasMany
|
|||
|
|
{
|
|||
|
|
return $this->hasMany(FactoryImageModel::class, 'factory', 'id');
|
|||
|
|
}
|
|||
|
|
}
|