Browse Source

添加修改配件类型的错误

lvhao 3 months ago
parent
commit
e270a1cf07
2 changed files with 48 additions and 1 deletions
  1. 9 1
      core/CoreApp/models/Model_api.php
  2. 39 0
      core/CoreApp/models/Model_logic_match.php

+ 9 - 1
core/CoreApp/models/Model_api.php

@@ -5,6 +5,7 @@ function __construct(){
 		$this->load->_model('Model_weight','weight');
 		$this->load->_model('Model_classid','classid');
 		$this->load->_model("Model_logic_ding","logic_ding");
+		$this->load->_model("Model_logic_match","logic_match");
 }
 
 	public function get_hq($name,$shopapi,$shop)
@@ -1132,7 +1133,7 @@ function __construct(){
 			//等级-真人发类型-化纤发编号-颜色-花型-蕾丝头套种类-化纤头套类型-多尺寸-单尺寸-Clip类型-礼物类型-马尾类型-重量-长度-头路设计-蕾丝尺寸25-蕾丝尺寸26-类型-密度-发帽大小-蕾丝颜色-化纤其它属性-头套其它属性-头套属性 100为头套额外附加
 			$cp = array(16=>126,22=>'',13=>80,14=>'',43=>'',8=>57,15=>'');//产品默认ID内容
 			//16->类目、22->真人发类型、13->等级、14->长度、8->颜色、15->曲度(花型)
-			$cptt = array(16=>128,13=>80,43=>'',8=>'57',15=>'',18=>'',6=>30,10=>72,9=>'',44=>'',39=>'',50=>'');//头套
+			$cptt = array(16=>128,13=>80,43=>'',8=>'57',15=>'',18=>'',6=>30,10=>72,9=>'',44=>'',39=>'',50=>'',51=>'');//头套
 			$cpcp = array(16=>130,13=>80,14=>'',33=>'',8=>57,15=>'',38=>'',7=>'');//卡子发,7=>33重量
 			$cpgi = array(16=>131,34=>'');//礼物
 			$cpac = array(16=>133,35=>'',7=>'');//配件
@@ -1399,6 +1400,13 @@ function __construct(){
 		        {
 					$fk[$k] = $v;//+号左右ID合并右完整ID
 			    }
+				
+				if(isset($fk[16]) && ($fk[16] ==133)){
+					$tmp = $this->logic_match->doAction($fk);
+					if(!empty($tmp)){
+						$fk = $tmp;
+					}
+				}
 				foreach ($fk as $v)
 		        {
 					$ptitleb .= isset($dtctitle[$v])?$dtctitle[$v].' ':'';

+ 39 - 0
core/CoreApp/models/Model_logic_match.php

@@ -0,0 +1,39 @@
+<?php
+/**
+ * 封装erp的商品匹配库  逐步替换统一处理吧
+ */
+class Model_logic_match extends Lin_Model {
+    /**
+     * $feather_arr  打散后获取的sku
+     */
+    public function doAction($feather_arr){
+        if($feather_arr[16] == 133){
+            return $this->peiJian($feather_arr);
+        }
+    }
+    //配件重组
+    private function peiJian($feather_arr){
+        //配件可能遇到的全部数组
+        $all_arr = [
+            16=>"",//类目           必存在
+            13=>"",//等级           必存在
+            14=>"",//长度           必存在
+            35=>"",//配件类型       必存在 
+            45=>"",//配件其它
+            8=>"",//颜色            必存在
+            15=>"",//曲度           必存在
+            38=>"",//单包片数
+            7=>"",//重量
+        ];
+        foreach($all_arr as $k=>$v){
+            if(isset($feather_arr[$k])){
+                $all_arr[$k] = $feather_arr[$k];
+            }
+        }   
+
+        return $all_arr;
+        
+
+    }
+
+}