24 lines
467 B
PHP
24 lines
467 B
PHP
<?php
|
|
|
|
namespace app\common\model;
|
|
|
|
use think\model\concern\SoftDelete;
|
|
|
|
class Cart extends BaseModel
|
|
{
|
|
use SoftDelete;
|
|
protected $name = 'cart';
|
|
protected $deleteTime = 'delete_time';
|
|
|
|
public function cartDishes()
|
|
{
|
|
return $this->hasOne(Dishes::class, 'id', 'dishes_id')->bind(['dishes_name' => 'name', 'image']);
|
|
}
|
|
|
|
public function cartProduct()
|
|
{
|
|
return $this->hasMany(CartProduct::class, 'cart_id', 'id');
|
|
}
|
|
|
|
}
|