|
@@ -87,24 +87,33 @@ class Apipf extends Start_Controller{
|
|
|
$send_list = [];
|
|
|
foreach($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(count($orderinfo['orders']) >= 4){
|
|
|
+ $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'],
|
|
|
+ ];
|
|
|
+ }else{
|
|
|
+ $this->customer->save([
|
|
|
+ 'more_three'=>3,
|
|
|
+ 'is_tb'=>1,
|
|
|
+ ],$v['id']);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if(empty($send_list)){
|