迁移并合并医生问诊评价接口
This commit is contained in:
@@ -6,6 +6,10 @@ namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $doctor_words_id 主键id
|
||||
* @property int $doctor_id 医生id
|
||||
@@ -13,11 +17,13 @@ namespace App\Model;
|
||||
* @property int $words_status 状态(0:禁用 1:启用)
|
||||
* @property int $sort 排序值(越大排序越靠前)
|
||||
* @property string $words 常用语
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property Carbon $created_at 创建时间
|
||||
* @property Carbon $updated_at 修改时间
|
||||
*/
|
||||
class DoctorWord extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
@@ -31,5 +37,39 @@ class DoctorWord extends Model
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['doctor_words_id' => 'integer', 'doctor_id' => 'integer', 'words_type' => 'integer', 'words_status' => 'integer', 'sort' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
protected array $casts = ['doctor_words_id' => 'string', 'doctor_id' => 'integer', 'words_type' => 'integer', 'words_status' => 'integer', 'sort' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
|
||||
protected string $primaryKey = "doctor_words_id";
|
||||
|
||||
/**
|
||||
* 获取信息-单条
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getOne(array $params, array $fields = ['*']): object|null
|
||||
{
|
||||
return self::where($params)->first($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息-多条
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getList(array $params, array $fields = ['*']): Collection|array
|
||||
{
|
||||
return self::where($params)->orderBy('sort','desc')->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param array $data
|
||||
* @return \Hyperf\Database\Model\Model|DoctorWord
|
||||
*/
|
||||
public static function addDoctorWord(array $data): \Hyperf\Database\Model\Model|DoctorWord
|
||||
{
|
||||
return self::create($data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user