Files
xk-api-yii/common/modelsgii/Drug.php
2024-09-19 11:32:39 +08:00

108 lines
3.5 KiB
PHP

<?php
namespace common\modelsgii;
use Yii;
/**
* This is the model class for table "yii_drug".
*
* @property int $id
* @property string $drug_name 药名
* @property string $pinyin_simple 拼音首拼
* @property string $source 货源(厂家)
* @property string $type 类型 1中药2西药3颗粒配方
* @property int $is_otc 是否处方药
* @property int $category_first 一级分类
* @property int $category_second 二级分类
* @property string|null $small_info 简介
* @property string|null $info 基础信息
* @property string|null $content 详情信息
* @property string $usage 用法
* @property string|null $function 功能主治
* @property string $specification 规格
* @property string|null $image 药品图片
* @property int $time_id 使用时间id
* @property int $type_id 使用方法id
* @property int $frequency_id 频率id
* @property int $unit_id 单位id
* @property int $number 数量
* @property int $status 状态 1草稿 2下架 3上架
* @property string|null $drug_number 药品编号
* @property string|null $bar_code 条形码
* @property string|null $guozi_no 国字准号
* @property string|null $drug_alias 药品别名
* @property string|null $place 产地
* @property int $decotion 煎法
* @property int $updated_at
* @property int $created_at
*/
class Drug extends \common\core\BaseActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'yii_drug';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['drug_name', 'type', 'status', 'created_at'], 'required'],
[['is_otc', 'category_first', 'category_second', 'time_id', 'type_id', 'frequency_id', 'unit_id', 'number', 'status', 'updated_at', 'created_at','decotion'], 'integer'],
[['info', 'content', 'image','instruction'], 'string'],
[['drug_name', 'source', 'drug_number', 'guozi_no', 'drug_alias', 'place'], 'string', 'max' => 100],
[['pinyin_simple'], 'string', 'max' => 50],
[['type'], 'string', 'max' => 20],
[['small_info'], 'string', 'max' => 150],
[['function'], 'string', 'max' => 500],
[['specification'], 'string', 'max' => 30],
[['bar_code','usage'], 'string', 'max' => 300],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'drug_name' => 'Drug Name',
'pinyin_simple' => '拼音首拼',
'source' => 'Source',
'type' => 'Type',
'is_otc' => 'Is Otc',
'category_first' => 'Category First',
'category_second' => 'Category Second',
'small_info' => 'Small Info',
'info' => 'Info',
'content' => 'Content',
'usage' => 'Usage',
'function' => 'Function',
'specification' => 'Specification',
'image' => 'Image',
'time_id' => 'Time ID',
'type_id' => 'Type ID',
'frequency_id' => 'Frequency ID',
'unit_id' => 'Unit ID',
'number' => 'Number',
'status' => 'Status',
'drug_number' => 'Drug Number',
'bar_code' => 'Bar Code',
'guozi_no' => 'Guozi No',
'drug_alias' => 'Drug Alias',
'place' => 'Place',
'decotion' => 'Decotion',
'instruction' => '说明书',
'updated_at' => 'Updated At',
'created_at' => 'Created At',
];
}
}