lvhao há 4 meses atrás
pai
commit
a11f323bf6
1 ficheiros alterados com 11 adições e 3 exclusões
  1. 11 3
      core/CoreApp/models/Model_logic_whlabel.php

+ 11 - 3
core/CoreApp/models/Model_logic_whlabel.php

@@ -8,6 +8,7 @@ class Model_logic_whlabel extends Lin_Model {
         $this->load->_model('Model_typeclass','typeclass');
         $this->load->_model('Model_classid','classid');
         $this->load->_model('Model_logic_weight','logic_weight');
+        $this->load->_model("Model_logic_u9tools","logic_u9tools");
     }
 
     protected $pmList = [];//品名匹配的数据
@@ -21,14 +22,20 @@ class Model_logic_whlabel extends Lin_Model {
      */
     public function dataTran($list,$condition){
         foreach($condition as $v){
-            if($v == 'pm'){
+            if($v == 'pm' ){
                 $this->pmData();
             }
         }
-        
+        if(in_array('pm',$condition)){
+            $classid = $this->pm;
+            $typeclass = $this->pmList;
+        }
         foreach($list as $k=>$v){
             if(in_array('pm',$condition)){
-                $list[$k]['pm'] = $this->getPm($v['features']);
+                $r = $this->logic_u9tools->getOneU9bm($v['features'],$classid,$typeclass);
+                $list[$k]['pm'] = $r['zh'];
+                $list[$k]['jm'] =  $r['jm'];
+                $list[$k]['bm'] =  $r['bm'];
             }
             if(in_array('weight',$condition)){
                 $list[$k]['weight'] = $this->getWeight($v['features']);
@@ -64,6 +71,7 @@ class Model_logic_whlabel extends Lin_Model {
 
         return $zh;
     }
+   
 
     protected function getWeight($features){
         $features = explode("-",trim($features,"-"));