longyi 4 月之前
父節點
當前提交
15e95bda31
共有 1 個文件被更改,包括 11 次插入9 次删除
  1. 11 9
      core/CoreApp/controllers/Apipf.php

+ 11 - 9
core/CoreApp/controllers/Apipf.php

@@ -56,6 +56,7 @@ class Apipf extends Start_Controller{
         }
         $hour = date("H");
         $minute = date("i");
+        $this->db->query("update crowd_customer set more_three = 1 where num >= 5 and more_three = 0");
         if($hour != 20){
             die("Execution conditions hour do not allow");
         }
@@ -77,7 +78,7 @@ class Apipf extends Start_Controller{
        if($api != $this->api){
             die("No data to be executed");
        }
-       $list = $this->customer->find_all("more_three = 1","id,shop,source,name,email,phone,money,num,country,province,city,street,address,address2,zipcode",'id asc',0,100);
+       $list = $this->customer->find_all("more_three = 1","id,shop,source,name,email,phone,money,num,country,province,city,street,address,address2,zipcode",'id asc',0,5);
        //$list = $this->customer->find_all("id = 71015","id,shop,source,name,email,phone,money,num,country,province,city,street,address,address2,zipcode",'id asc',0,100);
        if(empty($list)){
            die("This is a request without data");  
@@ -106,7 +107,6 @@ class Apipf extends Start_Controller{
             ];
        }
       
-      
        if(empty($send_list)){
           die("There is no customer data to be synchronized");  
        }
@@ -195,18 +195,19 @@ class Apipf extends Start_Controller{
                 if(!$flag_jishu){
                     $tmp_type++;
                     if(isset($quantity_arr[$key])){
-                        if(is_numeric($quantity[$index])){
-                            $tmp_qty = $quantity_arr[$key] + $tmp_qty;
+                        if(is_numeric($quantity_arr[$key])){
+                            $tmp_qty = $quantity_arr[$key]*1 + $tmp_qty;
                         }
                     }else{
                         $tmp_qty = $tmp_qty + 1;
                     }
                 }
-                // if(isset($quantity_arr[$key])){
-                //     $jisuan_qty = $quantity_arr[$key]*1 +  $jisuan_qty;
-                // }else{
-                //     $jisuan_qty =  $jisuan_qty + 1;
-                // }
+                if(isset($quantity_arr[$key])){
+                    $jisuan_qty = $quantity_arr[$key]*1 +  $jisuan_qty;
+                }else{
+                    $jisuan_qty =  $jisuan_qty + 1;
+                }
+               
                 
                 if(!empty($product_arr[$key])){
                     $sku_list[] = [
@@ -239,6 +240,7 @@ class Apipf extends Start_Controller{
             // var_dump($tmp_type);
             // var_dump($tmp_qty);
             // var_dump("------------------");
+            //var_dump($jisuan_qty);
             $order_mount = $order_mount +$v['shouldmoney']*1;//订单总金额
             $order_num++;//下单次数
             $order_qty =  $order_qty + $jisuan_qty;//订单产品总数