wugg 1 rok pred
rodič
commit
03652d31cf
1 zmenil súbory, kde vykonal 9 pridanie a 8 odobranie
  1. 9 8
      app/admin/model/DataChange.php

+ 9 - 8
app/admin/model/DataChange.php

@@ -39,15 +39,15 @@ class DataChange extends Model
         return $orderinfo;
     }
     
-    public function updateOrder($row) {
-		   if($row->type==1){
-		    $this->cgdUpdate($row);
+    public function updateOrder($data) {
+		   if($data['type']==1){
+		    $this->cgdUpdate($data);
 		   }
-		   if($row->type==2){
-		     $this->qrdUpdate($row);
+		   if($data['type']==2){
+		     $this->qrdUpdate($data);
 		   }
-		   if($row->type==3){
-		     $this->goodUpdate($row);
+		   if($data['type']==3){
+		     $this->goodUpdate($data);
 		   }
 	}
 	
@@ -171,7 +171,7 @@ class DataChange extends Model
 	* @param $row
 	 */
 	public function goodUpdate($row){
-        $good = Db::name("good_zixun")->where(["spuCode",$row->code])->findOrEmpty();
+        $good = Db::name("good_zixun")->where("spuCode",$row->code)->findOrEmpty();
         if(empty($good))throw new \Exception('未找到对应得商品数据');
            $after= json_decode($row->after,true);
          foreach ($after as $key=>$item){
@@ -179,6 +179,7 @@ class DataChange extends Model
         }
          $good['updatetime']=date("Y-m-d H:i:s");
          $goodup= Db::name('good_zixun')->save($good);
+
          if($goodup==false) throw new \Exception('商品数据更新失败');
          $saleup =Db::name("sale")->where("good_code",$row->code)->update(["updatetime"=>date('Y-m-d H:i:s')]);
          if($saleup==false) throw new \Exception('商品数据销售单更新失败');