修改物流
This commit is contained in:
@@ -46,14 +46,14 @@ class ReportRegulatoryCommand extends HyperfCommand
|
||||
{
|
||||
$this->line("开始");
|
||||
|
||||
// 获取需执行总数
|
||||
$order_prescription_count = $this->getOrderPrescriptionCount();
|
||||
if ($order_prescription_count <= 0) {
|
||||
// 获取未上传监管平台订单数量
|
||||
$report_regulatory_count = $this->getNotReportRegulatoryCount();
|
||||
if ($report_regulatory_count <= 0) {
|
||||
$this->line("结束:无可执行订单");
|
||||
return;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $order_prescription_count; $i++) {
|
||||
for ($i = 0; $i < $report_regulatory_count; $i++) {
|
||||
// 获取待上报订单
|
||||
$order_prescription = $this->getOrderPrescription($i);
|
||||
if (empty($order_prescription)) {
|
||||
@@ -218,6 +218,21 @@ class ReportRegulatoryCommand extends HyperfCommand
|
||||
return OrderPrescription::getStatusCount($params, $prescription_status_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取符合条件的订单
|
||||
*/
|
||||
private function getNotReportRegulatory(int $offset = 0,int $limit = 10)
|
||||
{
|
||||
$params = array();
|
||||
$params[] = ['report_inquiry_int','<',4];
|
||||
$params[] = ['report_prescription_int','<',4];
|
||||
|
||||
$or_params = array();
|
||||
$or_params['report_inquiry_status'] = 0;
|
||||
$or_params['report_prescription_status'] = 0;
|
||||
return ReportRegulatory::getOrStatusLimit($params,$or_params,['*'],$offset,$limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取符合条件的处方订单
|
||||
* @param int $offset 起始位置
|
||||
@@ -255,7 +270,7 @@ class ReportRegulatoryCommand extends HyperfCommand
|
||||
$redis_key = "ReportRegulatoryInquiry" . $order_prescription_id;
|
||||
$redis_value = $redis->get($redis_key);
|
||||
if (empty($redis_value)) {
|
||||
$redis->set($redis_key, 1, 60 * 60 * 24 * 5);
|
||||
$redis->set($redis_key, 1, 60 * 60 * 24 * 6);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user