Browse Source

fix:AI测量

super-yimizi 3 weeks ago
parent
commit
0867ca0d74

+ 1 - 0
add_new_measurement_fields.sql

@@ -0,0 +1 @@
+ 

+ 1 - 19
application/api/controller/BodyProfile.php

@@ -220,25 +220,6 @@ class BodyProfile extends Api
     }
 
     /**
-     * 获取体型推荐
-     */
-    public function getBodyTypeRecommendation()
-    {
-        $profile_id = $this->request->get('profile_id/d');
-
-        if (!$profile_id) {
-            $this->error('档案ID不能为空');
-        }
-
-        try {
-            $recommendations = BodyProfileService::getBodyTypeRecommendation($profile_id, $this->auth->id);
-            $this->success('获取成功', $recommendations);
-        } catch (\Exception $e) {
-            $this->error($e->getMessage());
-        }
-    }
-
-    /**
      * 生成AI测试报告
      */
     public function generateAiReport()
@@ -353,6 +334,7 @@ class BodyProfile extends Api
         $measurementFields = [
             'chest', 'waist', 'hip', 'thigh', 'calf', 'upper_arm', 'forearm', 
             'neck', 'shoulder_width', 'bust', 'underbust', 'inseam', 'outseam', 
+            'knee', 'arm_length', 'wrist', 'pants_length',
             'shoe_size', 'measurement_date'
         ];
         

+ 17 - 1
application/api/validate/BodyMeasurements.php

@@ -25,6 +25,10 @@ class BodyMeasurements extends Validate
         'underbust' => 'float|egt:0|elt:150',
         'inseam' => 'float|egt:0|elt:150',
         'outseam' => 'float|egt:0|elt:150',
+        'knee' => 'float|egt:0|elt:80',
+        'arm_length' => 'float|egt:0|elt:100',
+        'wrist' => 'float|egt:0|elt:30',
+        'pants_length' => 'float|egt:0|elt:150',
         'shoe_size' => 'length:0,10',
         'measurement_date' => 'date',
     ];
@@ -73,13 +77,25 @@ class BodyMeasurements extends Validate
         'outseam.float' => '外缝长必须是数字',
         'outseam.egt' => '外缝长不能小于0',
         'outseam.elt' => '外缝长不能大于150厘米',
+        'knee.float' => '膝围必须是数字',
+        'knee.egt' => '膝围不能小于0',
+        'knee.elt' => '膝围不能大于80厘米',
+        'arm_length.float' => '臂长必须是数字',
+        'arm_length.egt' => '臂长不能小于0',
+        'arm_length.elt' => '臂长不能大于100厘米',
+        'wrist.float' => '腕围必须是数字',
+        'wrist.egt' => '腕围不能小于0',
+        'wrist.elt' => '腕围不能大于30厘米',
+        'pants_length.float' => '裤长必须是数字',
+        'pants_length.egt' => '裤长不能小于0',
+        'pants_length.elt' => '裤长不能大于150厘米',
         'shoe_size.length' => '鞋码长度不能超过10个字符',
         'measurement_date.date' => '测量日期格式错误',
     ];
 
     // 验证场景
     protected $scene = [
-        'add' => ['profile_id', 'chest', 'waist', 'hip', 'thigh', 'calf', 'upper_arm', 'forearm', 'neck', 'shoulder_width', 'bust', 'underbust', 'inseam', 'outseam', 'shoe_size', 'measurement_date'],
+        'add' => ['profile_id', 'chest', 'waist', 'hip', 'thigh', 'calf', 'upper_arm', 'forearm', 'neck', 'shoulder_width', 'bust', 'underbust', 'inseam', 'outseam', 'knee', 'arm_length', 'wrist', 'pants_length', 'shoe_size', 'measurement_date'],
     ];
 
 

+ 4 - 0
application/common/model/BodyMeasurements.php

@@ -65,6 +65,10 @@ class BodyMeasurements extends Model
             'shoulder_width' => '肩宽',
             'inseam' => '内缝长',
             'outseam' => '外缝长',
+            'knee' => '膝围',
+            'arm_length' => '臂长',
+            'wrist' => '腕围',
+            'pants_length' => '裤长',
             'shoe_size' => '鞋码'
         ];
 

+ 1 - 0
updated_fa_body_measurements_table.sql

@@ -0,0 +1 @@
+