longyi 4 月之前
父节点
当前提交
0b6c052886
共有 1 个文件被更改,包括 62 次插入11 次删除
  1. 62 11
      core/CoreApp/controllers/Apipf.php

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

@@ -43,6 +43,9 @@ class Apipf extends Start_Controller{
         {
             $this->_tjOrder();
         }
+        elseif($arg == 'dd_all_tb'){
+            $this->_ddAllTb();
+        }
         else
         {
             exit('No direct script access allowed');
@@ -87,7 +90,7 @@ class Apipf extends Start_Controller{
        $send_list = [];
        foreach($list as $k=>$v){
             $orderinfo = $this->getOrderList($v['email'],$v['shop'],1);
-            if(count($orderinfo['orders']) >= 4){
+            if(count($orderinfo['orders']) > 4){
                 $send_list[] = [
                     'customer_id'=>$v['id'],
                     'name'=>$v['name'],
@@ -293,10 +296,11 @@ class Apipf extends Start_Controller{
             }
            
         }
+    
         $final_list = [];
         foreach($ret_list as $k=>$v){
             $orderitems = [];
-            foreach($sku_list as $key1 => $val1){
+            foreach($v['sku_list'] as $key1 => $val1){
                 $orderitems[] = [
                     'product_name'=>$val1['product_name'],
                     'sku'=>$val1['sku'],
@@ -442,13 +446,9 @@ class Apipf extends Start_Controller{
                     //判断sku中是否有这种东西
                     if (strpos($item,$val ) !== false) {
                        $jishu_flag = false;
-                        
-                        
                     } 
                     
                 }
-                var_dump($item);
-                var_dump($jishu_flag);
                 if($jishu_flag){
                     if(isset($quantity[$index])){
                         if(is_numeric($quantity[$index])){
@@ -492,7 +492,6 @@ class Apipf extends Start_Controller{
                 $tmp_q = 1;
             }
         }
-        var_dump($tmp_q);
         //大于等于4
         if($tmp_q >= 4){
             return true;
@@ -504,7 +503,7 @@ class Apipf extends Start_Controller{
 
    public function _tjOrder(){
         echo "<pre>";
-        var_dump(date("Y-m-d H:i:s"));
+        // var_dump(date("Y-m-d H:i:s"));
         // $save_list = [];
         // $list = $this->fullorder->find_all(" shop in (1,2,3,4,5,6) and source != 1 and state in (207,216) ","*",'id asc',1200000,300000);
         // foreach($list as $k=>$v){
@@ -528,9 +527,61 @@ class Apipf extends Start_Controller{
         // }
         // die("over");
         
-        $list = $this->fullorder->find_all(" number = 'YOLIS-01125-043' ","*",'id asc',0,300000);
-        $r = $this->judgeCon($list[0]);
-        var_dump($r);
+        // $list = $this->fullorder->find_all(" number = 'ALIP-00211-089' ","*",'id asc',0,300000);
+        // $r = $this->judgeCon($list[0]);
+        // var_dump($r);
+   }
+   
+   public function _ddAllTb(){
+       echo "<pre>";
+       $this->zzrecord_logs->find_all(" 1 = 1",'*','id asc',0,60);
+     
+       $customer_list = [];
+       foreach($list as $k=>$v){
+           $info = $this->fullorder->get_number($v['number']);
+           if(!empty($info)){
+               $customer = $this->customer->get_email($info['email'],$info['shop']);
+                if(!empty($customer)){
+                    $customer_list[] = $customer;
+                }
+           }
+           $this->zzrecord_logs->remove($v['id']);
+       }
+    //   var_dump($info['number']);
+       
+       $send_list = [];
+       foreach($customer_list as $k=>$v){
+            $orderinfo = $this->getOrderList($v['email'],$v['shop'],1);
+            $send_list[] = [
+                'customer_id'=>$v['id'],
+                'name'=>$v['name'],
+                'email'=>$v['email'],
+                'telephone'=>$v['phone'],
+                'ordered_mount'=>$orderinfo['order_mount'],
+                'ordered_num'=>$orderinfo['order_num'],
+                'ordered_qty'=>$orderinfo['order_qty'],
+                'max_ordered_qty'=>$orderinfo['max_order_qty'],
+                'brand'=>isset($this->shop_list[$v['shop']])?$this->shop_list[$v['shop']]:"other",
+                // 'country'=>$v['country'],
+                // 'province'=>$v['province'],
+                // 'city'=>$v['city'],
+                // 'street'=>$v['street'],
+                // 'address'=>$v['address'].$v['address2'],
+                // 'zipcode'=>$v['zipcode']
+                'orders'=>$orderinfo['orders'],
+            ];
+        }
+      
+       if(empty($send_list)){
+            return ;
+       }
+       $url = $this->url;
+       $header = [];
+       $res = $this->sendHttp($url,$header,['data'=>$send_list]);
+        var_dump($res);
+      
+       
+       
    }
 
 }