<?php require_once '/var/www/git/application/models/data/ItemInfo.php'; //获取商品信息为空的 $items = new ItemInfo(); $key = '`id`'; $string = '1=1'; $limit = 1000; $re = array(); $result = $items->iteminfo_select_key($key, $string, $limit); $count = 0; $group = 1; while ($r = mysql_fetch_array($result, true)) { $re[$group][] = $r['id']; $count++; if ($count == 50) { $group++; $count = 0; continue; } } //请求内容 $token = 'mengchun'; $appkey = '23182322'; $secret = '0bfab4f09119f33ebabb8348d314ceeb'; $tb_result = null; if (!is_null($re)) { foreach ($re as $key => $value) { $ids = implode(',', $value); $url = 'http://nuannuangouwu-1.wx.jaeapp.com/?token=' . $token . '&appkey=' . $appkey . '&secret=' . $secret . '&ids=' . $ids; $ch = curl_init($url);