liuhairui 4 days ago
parent
commit
cdd471ddde
2 changed files with 3 additions and 6 deletions
  1. 1 1
      application/api/controller/Staff.php
  2. 2 5
      application/api/controller/WorkOrder.php

+ 1 - 1
application/api/controller/Staff.php

@@ -230,7 +230,7 @@ class Staff extends Api
         }
 
         // 查询数据库是否已存在
-        $Find_list = Db::name('人员_基本资料')->where('staff_no', $staff_no)->find();
+        $Find_list = Db::name('人员_基本资料')->where('staff_no', $staff_no)->whereNull('mod_rq')->find();
         if($Find_list){
             $this->error('员工编号已存在');
         }

+ 2 - 5
application/api/controller/WorkOrder.php

@@ -2049,6 +2049,7 @@ class WorkOrder extends Api
             ->order('a.UNIQID desc')
             ->select();
 
+
         if (!empty($list)) {
             // 获取去重后的物料名称
             $materialNames = array_column($list, '物料名称');
@@ -2778,8 +2779,6 @@ class WorkOrder extends Api
 
     public function Gpt($massage)
     {
-//        $apiKey = 'sk-e0JuPjMntkbgi1BoMjrqyyzMKzAxILkQzyGMSy3xiMupuoWY';
-//        $apiKey = 'sk-Bhos1lXTRpZiAAmN06624a219a874eCd91Dc068b902a3e73';
         $apiKey = 'sk-fxlawqVtbbQbNW0wInR3E4wsLo5JHozDC2XOHzMa711su6ss';
         $messages = [
             [
@@ -2788,15 +2787,13 @@ class WorkOrder extends Api
             ]
         ];
         $data = [
-            'model' => 'gpt-4',
+            'model' => 'gpt-4.1',
             'messages' => $messages,
             'max_tokens' => 1024,
             'temperature' => 0.7,
         ];
 
         // 初始化 cURL 请求
-//        $ch = curl_init('https://niubi.zeabur.app/v1/chat/completions');
-//        $ch = curl_init('https://one.opengptgod.com/v1/chat/completions');
         $ch = curl_init('https://chatapi.onechats.top/v1/chat/completions');
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($ch, CURLOPT_HTTPHEADER, [