|
@@ -3,8 +3,10 @@
|
|
|
namespace App\Models;
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use App\Traits\Filterable;
|
|
use App\Traits\Filterable;
|
|
|
|
|
+use Illuminate\Database\Eloquent\Builder;
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
+use Illuminate\Support\Carbon;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -39,47 +41,49 @@ use Illuminate\Support\Facades\DB;
|
|
|
* @property string $sealed_report_url 盖章报告URL
|
|
* @property string $sealed_report_url 盖章报告URL
|
|
|
* @property array|null $raw_data 待签收原始数据(来源于querydrugreport)
|
|
* @property array|null $raw_data 待签收原始数据(来源于querydrugreport)
|
|
|
* @property array|null $seal_raw_data 已签收原始数据(来源于querysealdrugreport)
|
|
* @property array|null $seal_raw_data 已签收原始数据(来源于querysealdrugreport)
|
|
|
- * @property int $is_sign 是否签收(1-未签收、2-已签收)——定制
|
|
|
|
|
- * @property int $is_seal 是否盖章(1-未盖章、2-已盖章)——定制
|
|
|
|
|
- * @property \Illuminate\Support\Carbon $create_time 创建时间
|
|
|
|
|
- * @property \Illuminate\Support\Carbon $update_time 更新时间
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo applyFilters(array $filters = [], array $options = [])
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo newModelQuery()
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo newQuery()
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo query()
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereAssRefEntId($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereBatchNo($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereBillCode($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereBillDetailId($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereBillId($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereBillTime($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereBillType($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereCreateTime($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereDrugId($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereDrugName($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereDrugReportId($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereDrugReportV2Id($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereFromEntName($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereFromRefEntId($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereId($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereIsSeal($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereIsSign($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo wherePkgRatioList($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo wherePkgSpec($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo wherePrepnSpec($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo wherePrepnTypeDesc($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereProdCode($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereProduceDate($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereProduceEntId($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereProduceEntName($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereRawData($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereReportDate($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereReportId($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereReportName($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereReportNo($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereSealRawData($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereSealedReportUrl($value)
|
|
|
|
|
- * @method static \Illuminate\Database\Eloquent\Builder|DrugReportInfo whereUpdateTime($value)
|
|
|
|
|
|
|
+ * @property int $is_sign 是否签收(1-未签收、2-已签收)
|
|
|
|
|
+ * @property int $is_seal 是否盖章(1-未盖章、2-已盖章)
|
|
|
|
|
+ * @property Carbon $create_time 创建时间
|
|
|
|
|
+ * @property Carbon $update_time 更新时间
|
|
|
|
|
+ * @property-read string $is_seal_text
|
|
|
|
|
+ * @property-read string $is_sign_text
|
|
|
|
|
+ * @method static Builder|DrugReportInfo applyFilters(array $filters = [], array $options = [])
|
|
|
|
|
+ * @method static Builder|DrugReportInfo newModelQuery()
|
|
|
|
|
+ * @method static Builder|DrugReportInfo newQuery()
|
|
|
|
|
+ * @method static Builder|DrugReportInfo query()
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereAssRefEntId($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereBatchNo($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereBillCode($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereBillDetailId($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereBillId($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereBillTime($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereBillType($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereCreateTime($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereDrugId($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereDrugName($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereDrugReportId($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereDrugReportV2Id($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereFromEntName($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereFromRefEntId($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereId($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereIsSeal($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereIsSign($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo wherePkgRatioList($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo wherePkgSpec($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo wherePrepnSpec($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo wherePrepnTypeDesc($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereProdCode($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereProduceDate($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereProduceEntId($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereProduceEntName($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereRawData($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereReportDate($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereReportId($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereReportName($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereReportNo($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereSealRawData($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereSealedReportUrl($value)
|
|
|
|
|
+ * @method static Builder|DrugReportInfo whereUpdateTime($value)
|
|
|
* @mixin \Eloquent
|
|
* @mixin \Eloquent
|
|
|
*/
|
|
*/
|
|
|
class DrugReportInfo extends Model
|
|
class DrugReportInfo extends Model
|
|
@@ -100,10 +104,48 @@ class DrugReportInfo extends Model
|
|
|
'seal_raw_data' => 'array',
|
|
'seal_raw_data' => 'array',
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
|
|
+ protected $hidden = [
|
|
|
|
|
+ 'create_time',
|
|
|
|
|
+ 'update_time',
|
|
|
|
|
+ 'drug_report_v2_id',
|
|
|
|
|
+ 'drug_report_id',
|
|
|
|
|
+ 'pkg_ratio_list',
|
|
|
|
|
+ 'raw_data',
|
|
|
|
|
+ 'seal_raw_data',
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @var array|string[] 定义可搜索字段(可选,可在调用时覆盖)
|
|
* @var array|string[] 定义可搜索字段(可选,可在调用时覆盖)
|
|
|
*/
|
|
*/
|
|
|
- public static $searchable = ['id'];
|
|
|
|
|
|
|
+ public static $searchable = ['drug_id', 'drug_name', 'produce_ent_id', 'produce_ent_name'];
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取「是否签收」文本
|
|
|
|
|
+ * @return string
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getIsSignTextAttribute(): string
|
|
|
|
|
+ {
|
|
|
|
|
+ $options = [
|
|
|
|
|
+ 0 => '',
|
|
|
|
|
+ 1 => '未签收',
|
|
|
|
|
+ 2 => '已签收',
|
|
|
|
|
+ ];
|
|
|
|
|
+ return $options[$this->is_sign] ?? "未知「{$this->is_sign}」";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取「是否盖章」文本
|
|
|
|
|
+ * @return string
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getIsSealTextAttribute(): string
|
|
|
|
|
+ {
|
|
|
|
|
+ $options = [
|
|
|
|
|
+ 0 => '',
|
|
|
|
|
+ 1 => '未盖章',
|
|
|
|
|
+ 2 => '已盖章',
|
|
|
|
|
+ ];
|
|
|
|
|
+ return $options[$this->is_sign] ?? "未知「{$this->is_sign}」";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 批量更新或插入
|
|
* 批量更新或插入
|