Files
hyperf_service/app/Model/Supplier.php
LAPTOP-7SGDREK0\shiweijun 4e11fbaec8 feat:supplier
2025-01-22 17:53:00 +08:00

51 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Database\Model\Builder;
use Hyperf\DbConnection\Model\Model;
/**
* @property int $id
* @property string $name
* @property string $mobile
* @property string $address
* @property int $city_id
* @property int $kitchen_id
* @property int $is_del
* @property string $create_time
* @property string $update_time
*/
class Supplier extends Model
{
/**
* The table associated with the model.
*/
protected ?string $table = 'supplier';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = [];
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['id' => 'integer', 'city_id' => 'integer', 'kitchen_id' => 'integer', 'is_del' => 'integer'];
const CREATED_AT = 'create_time';
const 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',1)->first();
}
}