='{$stime}' and rui.add_time<'{$etime}' and rui.user_id not in(select distinct user_id from `order` where order_create_at>'{$stime}' and status>0 and user_id>0)"; $stmt = $_PDO->prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach($result as $k=>$v){ $params = array(); $params['user_id'] = $v['user_id']; $params['type'] = 5; //5 提醒新用户下单 $push_res = curl_post( ACT_PUSH_URL, $params); } # curl调用接口push function curl_post($url, $params){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); $response = curl_exec($ch); curl_close($ch); return $response; }