42 lines
868 B
PHP
42 lines
868 B
PHP
<?php
|
|
|
|
namespace app\common\model;
|
|
|
|
|
|
use app\common\model\BaseModel;
|
|
use think\model\concern\SoftDelete;
|
|
|
|
|
|
/**
|
|
* ProjectDishesProduct模型
|
|
* Class ProjectDishesProduct
|
|
* @package app\common\model
|
|
*/
|
|
class ProjectDishesProduct extends BaseModel
|
|
{
|
|
use SoftDelete;
|
|
protected $name = 'project_dishes_product';
|
|
protected $deleteTime = 'delete_time';
|
|
|
|
public function project()
|
|
{
|
|
return $this->hasOne(Project::class, 'id', 'project_id')->field('id,name');
|
|
}
|
|
|
|
public function dishes()
|
|
{
|
|
return $this->hasOne(Dishes::class, 'id', 'dishes_id')->field('id,name');
|
|
}
|
|
|
|
public function product()
|
|
{
|
|
return $this->hasOne(Product::class, 'id', 'product_id')->field('id,name');
|
|
}
|
|
|
|
public function unit()
|
|
{
|
|
return $this->hasOne(ProductUnit::class, 'id', 'unit_id')->field('id,name');
|
|
}
|
|
|
|
}
|