1
This commit is contained in:
parent
88a04aa4e8
commit
516a2ace66
@ -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);
|
||||
}
|
||||
@ -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();
|
||||
|
||||
@ -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));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user