58 lines
1.9 KiB
PHP
58 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Models\YiiModels;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* App\Models\YiiModels\DrugstoreDrug
|
|
*
|
|
* @property int $id
|
|
* @property int $drugstore_id 药房id
|
|
* @property int $drug_id 药id
|
|
* @property int $type 类型 1中药2西药3颗粒配方
|
|
* @property string $price 销售价格
|
|
* @property string|null $market_price 市场价
|
|
* @property int $stock 库存
|
|
* @property int|null $status 状态1下架2上架
|
|
* @property int $frozen_number 冻结数量
|
|
* @property \Illuminate\Support\Carbon $created_at
|
|
* @property \Illuminate\Support\Carbon $updated_at
|
|
* @property-read \App\Models\YiiModels\Drug|null $drug 药品
|
|
* @property-read \App\Models\YiiModels\Drugstore|null $drugstore 药房
|
|
* @property-read string $created_at_format 创建时间的格式化
|
|
* @property-read string $status_string 状态名称
|
|
* @property-read string $updated_at_format 更新时间的格式化
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\DrugstoreDrug newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\DrugstoreDrug newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\DrugstoreDrug query()
|
|
* @mixin \Eloquent
|
|
*/
|
|
class DrugstoreDrug extends YiiBaseModel
|
|
{
|
|
// 药品类型
|
|
public const TYPE_CHINESE_DRUG = Drug::TYPE_CHINESE_DRUG;
|
|
public const TYPE_WEST_DRUG = Drug::TYPE_WEST_DRUG;
|
|
public const TYPE_PELLET_DRUG = Drug::TYPE_PELLET_DRUG;
|
|
public const TYPE_PELLET_PATENT = Drug::TYPE_PELLET_PATENT;
|
|
public const TYPE = Drug::TYPE;
|
|
|
|
/**
|
|
* @comment 药品
|
|
* @return BelongsTo
|
|
*/
|
|
public function drug(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Drug::class, 'drug_id');
|
|
}
|
|
|
|
/**
|
|
* @comment 药房
|
|
* @return BelongsTo
|
|
*/
|
|
public function drugstore(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Drugstore::class, 'drugstore_id');
|
|
}
|
|
}
|