hu hao 5 лет назад
Родитель
Сommit
bf60276fbe

+ 4 - 0
app/Jobs/ProcurementConfirmInform.php

@@ -3,6 +3,7 @@
 namespace App\Jobs;
 
 use App\Procurement;
+use App\Services\LogService;
 use App\Services\ProcurementWeiXinSendMessageService;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -36,6 +37,7 @@ class ProcurementConfirmInform implements ShouldQueue
         $pro=$this->procurement->loadMissing(['ownerMaterial.material.supplier.user.userDetail','ownerMaterial.owner.customer']);
         if (empty($pro->ownerMaterial->material->supplier))return;
         $suppliers=$pro->ownerMaterial->material->supplier;
+        LogService::log(__METHOD__,"采购单耗材关联供应商1",json_decode($suppliers));
         $open_ids=[];
         foreach ($suppliers as $supplier) {
             foreach ($supplier->user as $user){
@@ -44,6 +46,7 @@ class ProcurementConfirmInform implements ShouldQueue
             }
         }
         $open_ids=array_unique($open_ids);
+        LogService::log(__METHOD__,"发送用户openid2",json_decode($open_ids));
         foreach ($open_ids as $open_id){
             $param['touser'] =$open_id;
             $param['mp_template_msg'] =[
@@ -71,6 +74,7 @@ class ProcurementConfirmInform implements ShouldQueue
                     ],
                 ]
             ];
+            LogService::log(__METHOD__,"模板信息3",json_decode($param));
             app(ProcurementWeiXinSendMessageService::class)->sendWenChantTemplate($param);
         }
 

+ 2 - 0
app/Services/ProcurementWeiXinSendMessageService.php

@@ -14,6 +14,7 @@ class ProcurementWeiXinSendMessageService
         $result = file_get_contents($url);
         $result = json_decode($result,true);
         if (array_key_exists("access_token", $result)) return $result['access_token'];
+        LogService::log(__METHOD__,"模板信息5",json_decode($result));
         return null;
     }
     //发送微信模版消息通知
@@ -61,6 +62,7 @@ class ProcurementWeiXinSendMessageService
         curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
         $output = curl_exec($curl);
         curl_close($curl);
+        LogService::log(__METHOD__,"模板信息4",json_decode($output));
         return $output;
     }