Files
hyperf_service/app/Model/Dish.php
LAPTOP-7SGDREK0\shiweijun d58b773dc8 feat:depotPurchase
2025-01-23 17:55:14 +08:00

58 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Model;
use App\Constants\Common\DishCode;
use Hyperf\Database\Model\Builder;
use Hyperf\DbConnection\Model\Model;
/**
* @property int $id
* @property string $dish
* @property string $profile
* @property int $pre_quantity
* @property string $price
* @property string $side_dish
* @property string $flavor
* @property int $cycle_id
* @property int $status
* @property int $city_id
* @property int $kitchen_id
* @property int $chef_id
* @property int $is_del
* @property string $create_time
* @property string $update_time
*/
class Dish extends Model
{
/**
* The table associated with the model.
*/
protected ?string $table = 'dish';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = [];
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['id' => 'integer', 'pre_quantity' => 'integer', 'cycle_id' => 'integer', 'status' => 'integer', 'city_id' => 'integer','kitchen_id' => 'integer', 'chef_id' => 'integer', 'is_del' => 'integer'];
const string CREATED_AT = 'create_time';
const string UPDATED_AT = 'update_time';
/**
* @param int $id
* @return \Hyperf\Database\Model\Model|Builder|null
*/
public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null
{
return $this->where('id',$id)->where('is_del',DishCode::IS_NO_DEL)->first();
}
}