diff --git a/app/Model/CodeLog.php b/app/Model/LogCode.php similarity index 71% rename from app/Model/CodeLog.php rename to app/Model/LogCode.php index b460349..3951caf 100644 --- a/app/Model/CodeLog.php +++ b/app/Model/LogCode.php @@ -20,26 +20,21 @@ use Hyperf\Snowflake\Concern\Snowflake; * @property \Carbon\Carbon $created_at 创建时间 * @property \Carbon\Carbon $updated_at 修改时间 */ -class CodeLog extends Model +class LogCode extends Model { use Snowflake; /** * The table associated with the model. */ - protected ?string $table = 'code_log'; + protected ?string $table = 'log_code'; /** * The attributes that are mass assignable. */ - protected array $fillable = ['code_log_id', 'type', 'status', 'scene', 'phone', 'code', 'third_code', 'remarks', 'created_at', 'updated_at']; + protected array $fillable = ['log_id', 'type', 'status', 'scene', 'phone', 'code', 'third_code', 'remarks', 'created_at', 'updated_at']; - /** - * The attributes that should be cast to native types. - */ - protected array $casts = ['code_log_id' => 'string', 'type' => 'integer', 'status' => 'integer', 'scene' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime']; - - protected string $primaryKey = "code_log_id"; + protected string $primaryKey = "log_id"; /** * 获取信息-单条 @@ -68,9 +63,9 @@ class CodeLog extends Model /** * 新增-批量 * @param array $data - * @return \Hyperf\Database\Model\Model|CodeLog + * @return \Hyperf\Database\Model\Model|LogCode */ - public static function addCodeLog(array $data): \Hyperf\Database\Model\Model|CodeLog + public static function addCodeLog(array $data): \Hyperf\Database\Model\Model|LogCode { return self::create($data); } diff --git a/app/Services/InquiryService.php b/app/Services/InquiryService.php index 8682451..4d8a444 100644 --- a/app/Services/InquiryService.php +++ b/app/Services/InquiryService.php @@ -190,7 +190,7 @@ class InquiryService extends BaseService $data['is_family_history'] = $request_params['is_family_history'] ?: 0; // 是否存在家族病史(0:否 1:是) $data['family_history'] = $request_params['family_history'] ?? null; // 家族病史描述 $data['is_pregnant'] = $request_params['is_pregnant'] ?: 0; // 是否备孕、妊娠、哺乳期(0:否 1:是) - $data['is_taboo'] = $request_params['is_taboo'] ?: 0; // 是否存在禁忌药物(0:否 1:是)问诊购药时存在 + $data['is_taboo'] = $request_params['is_taboo'] ?? 0; // 是否存在禁忌药物(0:否 1:是)问诊购药时存在 $order_inquiry_case = OrderInquiryCase::addOrderInquiryCase($data); if (empty($order_inquiry_case)) { Db::rollBack(); diff --git a/extend/Alibaba/Dysms.php b/extend/Alibaba/Dysms.php index 1b6a8c1..053b0eb 100644 --- a/extend/Alibaba/Dysms.php +++ b/extend/Alibaba/Dysms.php @@ -3,7 +3,7 @@ namespace Extend\Alibaba; use App\Constants\HttpEnumCode; use App\Exception\BusinessException; -use App\Model\CodeLog; +use App\Model\LogCode; use Darabonba\OpenApi\OpenApiClient; use AlibabaCloud\OpenApiUtil\OpenApiUtilClient; @@ -118,7 +118,7 @@ class Dysms $data['code'] = $template_code; $data['third_code'] = $result['body']['RequestId']; $data['remarks'] = json_encode($template_param,JSON_UNESCAPED_UNICODE); - $res = CodeLog::addCodeLog($data); + $res = LogCode::addCodeLog($data); if (empty($res)){ // 发送成功,记录失败 throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::CODE_FAIL));