diff --git a/app/Model/Product.php b/app/Model/Product.php index 7059df5..42dfb44 100644 --- a/app/Model/Product.php +++ b/app/Model/Product.php @@ -13,6 +13,9 @@ use Hyperf\Snowflake\Concern\Snowflake; /** * @property int $product_id 主键id * @property int $product_platform_id 处方平台商品id + * @property int $product_status 商品状态(1:正常 2:下架) + * @property int $is_delete 是否删除(0:否 1:是) + * @property int $prescription_num 处方可开具的数量 * @property string $product_name 商品名称 * @property string $common_name 商品通用名 * @property string $product_price 商品价格 @@ -32,6 +35,7 @@ use Hyperf\Snowflake\Concern\Snowflake; * @property string $product_remarks 商品备注 * @property \Carbon\Carbon $created_at 创建时间 * @property \Carbon\Carbon $updated_at 修改时间 + * @property-read ProductPlatformAmount|null $ProductPlatformAmount */ class Product extends Model { @@ -45,7 +49,7 @@ class Product extends Model /** * The attributes that are mass assignable. */ - protected array $fillable = ['product_id', 'product_platform_id', 'product_name', 'common_name', 'product_price', 'mnemonic_code', 'product_type', 'product_platform_code', 'product_pharmacy_code', 'product_cover_img', 'product_spec', 'license_number', 'manufacturer', 'single_unit', 'single_use', 'packaging_unit', 'frequency_use', 'available_days', 'product_remarks', 'created_at', 'updated_at']; + protected array $fillable = ['product_id', 'product_platform_id', 'product_status', 'is_delete', 'prescription_num', 'product_name', 'common_name', 'product_price', 'mnemonic_code', 'product_type', 'product_platform_code', 'product_pharmacy_code', 'product_cover_img', 'product_spec', 'license_number', 'manufacturer', 'single_unit', 'single_use', 'packaging_unit', 'frequency_use', 'available_days', 'product_remarks', 'created_at', 'updated_at']; protected string $primaryKey = "product_id"; diff --git a/app/Model/ReportRegulatory.php b/app/Model/ReportRegulatory.php index 32a051a..a56d33a 100644 --- a/app/Model/ReportRegulatory.php +++ b/app/Model/ReportRegulatory.php @@ -132,4 +132,14 @@ class ReportRegulatory extends Model }) ->get($fields); } + + /** + * 检测是否存在 + * @param array $params + * @return bool + */ + public static function getExists(array $params): bool + { + return self::where($params)->exists(); + } } diff --git a/app/Services/BasicDataService.php b/app/Services/BasicDataService.php index 06c4ce0..53fc67b 100644 --- a/app/Services/BasicDataService.php +++ b/app/Services/BasicDataService.php @@ -226,6 +226,7 @@ class BasicDataService extends BaseService $fields = [ 'product_id', 'product_platform_id', + 'prescription_num', 'product_name', 'product_price', 'product_cover_img', @@ -239,7 +240,8 @@ class BasicDataService extends BaseService ]; $params = array(); - + $params['product_status'] = 1; + $params['is_delete'] = 0; $product = Product::getSearchKeywordList($params, $product_keyword,$fields); if (empty($product)) { return success(); diff --git a/app/Services/InquiryService.php b/app/Services/InquiryService.php index 72e4f2e..16ef330 100644 --- a/app/Services/InquiryService.php +++ b/app/Services/InquiryService.php @@ -1091,7 +1091,6 @@ class InquiryService extends BaseService $message = new AutoFinishInquiryDelayDirectProducer($data); $message->setDelayMs(1000 * 60 * 60 * 24 * 3); -// $message->setDelayMs(1000 * 60 * 2); $producer = $this->container->get(Producer::class); $res = $producer->produce($message); if (!$res) { @@ -1101,7 +1100,7 @@ class InquiryService extends BaseService Db::commit(); } catch (\Exception $e) { Db::rollBack(); - Log::getInstance()->error("错误:" . $e->getMessage()); + Log::getInstance("InquiryService-putFinishInquiry")->error($e->getMessage()); return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage()); } @@ -1120,8 +1119,8 @@ class InquiryService extends BaseService // 患者-发送通知消息-患者的问诊服务结束 $MessagePush = new MessagePush($order_inquiry['user_id'], $order_inquiry['order_inquiry_id']); $MessagePush->patientInquiryFinish(); - } catch (\Exception $e) { - return success([], HttpEnumCode::HTTP_SUCCESS, "消息发送失败"); + } catch (\Throwable $e) { + Log::getInstance("InquiryService-putFinishInquiry")->error($e->getMessage()); } return success(); diff --git a/app/Services/ReportRegulatoryService.php b/app/Services/ReportRegulatoryService.php new file mode 100644 index 0000000..b098b31 --- /dev/null +++ b/app/Services/ReportRegulatoryService.php @@ -0,0 +1,38 @@ +