| xqd
@@ -29,46 +29,24 @@ class chatOrder implements ToCollection,WithBatchInserts,WithChunkReading
|
|
|
|
|
|
foreach ($collection as $row) {
|
|
|
if ($row[0] == '订单编号') continue;
|
|
|
-// dd($row);
|
|
|
-
|
|
|
-// [
|
|
|
-// 0 => "im20210118173813522",
|
|
|
-// 1 => "云南运营主体",
|
|
|
-// 2 => "熊振宇",
|
|
|
-// 3 => "13708872753",
|
|
|
-// 4 => "文菊焱",
|
|
|
-// 5 => "",
|
|
|
-// 6 => "云南省昆明市昆明市盘龙区联盟街道金康园社区卫生服务站",
|
|
|
-// 7 => "妇保科",
|
|
|
-// 8 => "否",
|
|
|
-// 9 => "进行中",
|
|
|
-// 10 => "",
|
|
|
-// 11 => "否",
|
|
|
-// 12 => "1.99",
|
|
|
-// 13 => "0.00",
|
|
|
-// 14 => "1.99",
|
|
|
-// 15 => "1.99",
|
|
|
-// 16 => "微信支付",
|
|
|
-// 17 => "单次图文咨询",
|
|
|
-// 18 => "已付款",
|
|
|
-// 19 => "2021-01-18 17:38:13",
|
|
|
-// ];
|
|
|
//检查是否有该订单
|
|
|
$isHave = $this->getValue(new Order(), ['order_sn' => $row[0]], 'id');
|
|
|
- if ($isHave) return null;
|
|
|
+ if ($isHave) continue;
|
|
|
|
|
|
$user_id = $this->getValue(new User(), ['phone' => $row[3]], 'id');
|
|
|
if (empty($user_id)) {
|
|
|
echo $row[3] . '用户缺失' . PHP_EOL;
|
|
|
- return null;
|
|
|
+ continue;
|
|
|
}
|
|
|
//患者信息
|
|
|
- $patientInfo = Patient::where(['name' => $row[4]])->first();
|
|
|
+ $patientInfo = Patient::where(['name' => $row[2]])->first();
|
|
|
if (empty($patientInfo)) {
|
|
|
- echo $row[4] . '患者缺失' . PHP_EOL;
|
|
|
+// $pp = Patient::where('user_id',$user_id)->get()->toArray();
|
|
|
+ echo $row[2] . '患者缺失' . PHP_EOL;
|
|
|
continue;
|
|
|
}
|
|
|
- $org_id = $this->getValue(new Organization(), ['name' => $row[6]], 'id');
|
|
|
+ $org_name = substr($row[6],18);
|
|
|
+ $org_id = $this->getValue(new Organization(), ['name' => $org_name], 'id');
|
|
|
if (empty($org_id)) {
|
|
|
echo $row[6] . '机构缺失' . PHP_EOL;
|
|
|
continue;
|
| xqd
@@ -79,23 +57,18 @@ class chatOrder implements ToCollection,WithBatchInserts,WithChunkReading
|
|
|
Log::info('订单没有用户信息,订单编号: ' . $row[0] . PHP_EOL);
|
|
|
continue;
|
|
|
}
|
|
|
- // 1 => "未支付"
|
|
|
- // 2 => "待支付"
|
|
|
- // 3 => "进行中"
|
|
|
- // 4 => "已完成"
|
|
|
- // 5 => "已取消"
|
|
|
- // 6 => "已超时"
|
|
|
- // 7 => "已预约"
|
|
|
+
|
|
|
//订单状态
|
|
|
$status = Order::getStatus();
|
|
|
//订单状态
|
|
|
$paystatus = Order::getPayStatus();
|
|
|
$pay_status = array_search($row[18], $paystatus);
|
|
|
$order_status = array_search($row[9], $status);
|
|
|
+ if($row[9] == '已过期') $order_status = 6;
|
|
|
+ if($row[18] == '未付款' || empty($row[18])) $pay_status = 1;
|
|
|
|
|
|
|
|
|
$docter_id = $this->getValue(new Docter(), ['name' => $row[4]], 'id');
|
|
|
- $org_id = $this->getValue(new Organization(), ['name' => $row[6]], 'id');
|
|
|
$evaluate = $row[10] == '已评价' ? 1 : 0;
|
|
|
$pay_types = [1 => '微信支付', 2 => '余额支付', 3 => '服务包支付'];
|
|
|
//支付方式
|