options = [ 'token' => '', 'appid' => 'wxbdec8558931efffd', 'appsecret' => '583b3cd0d8e145009eda61ece003ca14', 'encodingaeskey' => '', 'debug' => false ]; $this->load->model('market/market_sylive_activity_model'); $this->load->model('live/Live_polyv_session_model', 'mdPolyvSession'); $this->load->model('live/Live_polyv_viewlog_model', 'mdPolyvViewlog'); $this->load->library('PolyvApi'); } /** * Notes:发送一次性订阅 * Created on: 2020/11/30 17:02 * Created by: dengbw * https://liche-api-dev.xiaoyu.com/plan/syt/subscribemsg * https://api.liche.cn/plan/syt/subscribemsg */ public function subscribemsg() { $size = $this->input->get('size'); !$size && $size = 10; $this->load->model('market/market_sylive_subscribemsg_model', 'mdSytSubscribemsg'); $count = $this->mdSytSubscribemsg->count(['status'=>0]); if($count>5000){ $date = date('Y-m-d H:i:s', strtotime('+10 minute'));//提前10分钟发送 }else{ $date = date('Y-m-d H:i:s'); } $where['timeStart<='] = $date; $where['status'] = 0; $count = $this->mdSytSubscribemsg->count($where); if($count>1000){ $min_row = $this->mdSytSubscribemsg->get($where,'min(id) as id'); $max_row = $this->mdSytSubscribemsg->get($where,'max(id) as id'); $ids_arr = []; for($i=0;$i<$size;$i++){ $s_id = rand($min_row['id'],$max_row['id']); $s_id += 1; $ids_arr[] = $s_id; } $ids = implode(',',array_unique($ids_arr)); $ids && $where["id in ({$ids})"] = null; } $res = $this->mdSytSubscribemsg->select($where, 'id asc', 1, $size); $log = array(); if ($res) { $wechatS = new WechatServer($this->options); $wechatS->checkAuth(); $act_ids = implode(',',array_unique(array_column($res,'activityId'))); $act_rows = []; if($act_ids){ $where = [ "activityId in ($act_ids)" => null ]; $act_rows = $this->market_sylive_activity_model->map('activityId','',$where,'',0,0,'activityId,title'); } foreach ($res as $key => $value) { $act = $act_rows[$value['activityId']] ? $act_rows[$value['activityId']][0] : []; if ($act) { $content = '您预约“' . $act['title'] . '”直播已经开始啦!赶紧进入直播间观看直播领取福利吧~'; $temp_arr = array( 'touser' => $value['openId'], 'template_id' => $value['templateId'], 'url' => $value['url'], 'scene' => $value['scene'], 'title' => '开播提醒', 'data' => array( 'content' => array('value' => $content) ) ); $re = $wechatS->subscribeTemplateMessage($temp_arr); if ($re) {//errcode 0(发送成功) 43101(已发送过) if ($re['errcode'] == 0) { $this->mdSytSubscribemsg->update(['status' => 1], ['id' => $value['id']]); $log[] = $value['activityId'] . '=' . $value['openId']; }else{ $this->mdSytSubscribemsg->update(['status' => -1], ['id' => $value['id']]); } } }else{ $this->mdSytSubscribemsg->update(['status' => -1], ['id' => $value['id']]); } } $log && print_r($log); $total = count($res); $do = count($log); debug_log("[info] " . __FUNCTION__ . "# date:{$date}; total:{$total}; do:{$do};", $this->log_file); } echo '
数据库获取:'; echo json_encode($res, JSON_UNESCAPED_UNICODE); echo '

成功发送:'; } /** * Notes:私域通直播间数据同步 * https://liche-api-dev.xiaoyu.com/plan/syt/syn_polyv * https://api.liche.cn/plan/syt/syn_polyv * Created on: 2022/9/30 15:05 * Created by: dengbw */ public function syn_polyv() { $a_id = $this->input->get('a_id'); $where = [ 'status' => 0, "channelId <> ''" => null, "timeStart<" => date('Y-m-d H:i:s'), "timeStart>" => date('Y-m-d H:i:s', strtotime("-1 day")) ]; $a_id && $where = ['activityId' => $a_id]; $rows = $this->market_sylive_activity_model->select($where, 'activityId desc', 1, 20, 'activityId,channelId,timeStart,timeEnd'); if ($rows) { foreach ($rows as $item) { debug_log("开始同步{$item['activityId']}活动直播", $this->log_file, $this->log_dir); $polyv = new PolyvApi(['channel_id' => $item['channelId']]); $pl_where = [ 'startTime' => (strtotime($item['timeStart'])-10*60*60) * 1000, 'endTime' => (strtotime($item['timeEnd'])+24*60*60) * 1000 ]; $results = $polyv->getSessionStats($pl_where); if ($results['status'] == 'success') { foreach ($results['data']['list'] as $key => $value) { $re = $this->mdPolyvSession->get(['channelId' => $item['channelId'], 'sessionId' => $value['sessionId']]); $data = [ 'channelId' => $value['channelId'], 'sessionId' => $value['sessionId'], 'name' => $value['name'], 'startTime' => $value['startTime'], 'endTime' => $value['endTime'], 'duration' => $value['duration'], 'liveUV' => $value['liveUV'], 'livePV' => $value['livePV'], 'playbackUV' => $value['playbackUV'], 'playbackPV' => $value['playbackPV'], 'totalPlayDuration' => $value['totalPlayDuration'], 'session_time' => date('Y-m-d H:i:s'), ]; if ($re) {//同步更新数据 $session['id'] = $re['id']; $this->mdPolyvSession->update($data, ['id' => $re['id']]); } else {//新增 $data['c_time'] = time(); $session['id'] = $this->mdPolyvSession->add($data); } } $msg = "同步成功:" . json_encode($results, JSON_UNESCAPED_UNICODE); echo $msg . "
"; } else { $msg = "接口错误:" . $results['message']; echo $msg . "
"; } debug_log($msg, $this->log_file, $this->log_dir); } } else { echo "暂无同步数据"; } } /** * Notes:同步保利威分页查询频道直播观看详情数据 * Created on: 2022/9/30 14:56 * Created by: dengbw * @param $session */ public function api_viewlog() { $session_id = $this->input->get('session_id'); $redis = &load_cache('redis'); $ckey = 'PLV_SESSION_LASTID'; $t1 = 'lc_live_polyv_session'; $t2 = 'lc_market_sylive_activity'; $where = [ "$t2.activityId>" => 0 ]; if($session_id){ $where["{$t1}.id"] = $session_id; }else{ $last_id = $redis->get($ckey); $last_id && $where["{$t1}.id>"] = $last_id; } $fileds = "{$t1}.*,{$t2}.activityId"; $rows = $this->db->select($fileds)->from("$t1") ->join("$t2", "{$t2}.channelId={$t1}.channelId", 'left') ->where($where)->order_by("{$t1}.id asc")->limit(1, 0) ->get()->result_array(); if($rows){ foreach ($rows as $key => $val) { $p_ckey = "PLV_CID{$val['channelId']}_{$val['sessionId']}_{$val}"; //分页缓存 $page = $redis->get($p_ckey); !$page && $page = 1; $s_msg = "开始同步{$val['activityId']}活动直播,频道id:{$val['channelId']},场次id:{$val['sessionId']},分页{$page}"; debug_log($s_msg, $this->log_file, $this->log_dir); echo $s_msg."
"; $params = [ 'channelId' => $val['channelId'], 'sessionId' => $val['sessionId'], 'startTime' => $val['startTime'], 'endTime' => $val['endTime'], 'page' => $page, 'pageSize' => 100 ]; $results = $this->getViewLog($params); if ($results['status'] == 'success') { if(!$results['data']['lastPage'] && $results['data']['pageNumber'] != $results['data']['nextPageNumber']){ $redis->save($p_ckey,$results['data']['nextPageNumber'],24*60*60); $left_page = $results['data']['totalPages'] - $page; $msg = "第:{$page}页同步完成,剩余:{$left_page}页"; }else{ //执行结束 $redis->save($ckey,$val['id']); $msg = "同步完成"; } debug_log($msg, $this->log_file, $this->log_dir); echo $msg."
"; }else{ $msg = "接口错误:" . $results['message']; echo $msg . "
"; } } }else{ echo "不存在需要同步数据"; } } /** * Notes:增加观看日志 * Created on: 2022/9/30 14:56 * Created by: dengbw * @param $params * @return bool|string */ private function getViewLog($params) { $this->load->library('PolyvApi'); $polyv = new PolyvApi(['channel_id' => $params['channelId']]); $results = $polyv->getViewLog($params); if ($results['status'] == 'success') { $addData = []; foreach ($results['data']['contents'] as $key => $value) { $re = $this->mdPolyvViewlog->get(['playId' => $value['playId']]); $data = [ 'channelId' => $value['channelId'], 'sessionId' => $value['sessionId'], 'playId' => $value['playId'], 'userId' => $value['userId'], 'playDuration' => $value['playDuration'], 'stayDuration' => $value['stayDuration'], 'flowSize' => $value['flowSize'], 'param1' => $value['param1'], 'param2' => $value['param2'], 'param3' => $value['param3'], 'param4' => $value['param4'], 'param5' => $value['param5'], 'ptype' => $value['ptype'], 'ipAddress' => $value['ipAddress'], 'country' => $value['country'], 'province' => $value['province'], 'city' => $value['city'], 'isp' => $value['isp'], 'referer' => $value['referer'], 'userAgent' => $value['userAgent'], 'operatingSystem' => $value['operatingSystem'], 'browser' => $value['browser'], 'isMobile' => $value['isMobile'], 'currentDay' => $value['currentDay'], 'createdTime' => $value['createdTime'], 'lastModified' => $value['lastModified'], ]; if ($re) {//同步更新数据 $this->mdPolyvViewlog->update($data, ['id' => $re['id']]); } else {//新增 $data['c_time'] = time(); $addData[] = $data; } } if ($addData && count($addData)) {//新增数据 $this->mdPolyvViewlog->add_batch($addData); } } return $results; } //订单过期 public function out_time(){ $this->load->model('market/market_sylive_activity_orders_model','mdSytActivityOrders'); $this->load->model('market/market_sylive_order_model'); $this->load->model('market/market_sylive_items_model'); //商家订单过期 $where = [ 'expireTime>' => 0, 'expireTime<' => time(), 'status' => 0 ]; $this->mdSytActivityOrders->update(['status'=>-1],$where); //用户订单过期 $where = [ 'expireTime>' => 0, 'expireTime<' => time(), 'status' => 0, ]; $rows = $this->market_sylive_order_model->select($where,'id asc',1,20); if($rows){ foreach ($rows as $key => $val) { $res = $this->market_sylive_order_model->update(['status'=>-1],['id'=>$val['id']]); if($res){ $up_data = [ 'stock = stock+1' => null ]; $this->market_sylive_items_model->update($up_data,['itemId'=>$val['itemId']]); } } } } //关联观看日志 public function union_user(){ $this->load->library('market/sylive_entity'); $this->load->model('market/market_sylive_user_model', 'user_model'); $this->load->model('market/market_sylive_activity_user_model', 'act_user_model'); $this->load->model('market/market_sylive_viewlog_model'); $size = 30; $t1 = 'lc_live_polyv_viewlog'; $t2 = 'lc_market_sylive_activity'; $t3 = 'lc_market_sylive_viewlog'; $where = [ "$t2.activityId>" => 0, "$t3.id is null" => null ]; $fileds = "{$t1}.*,{$t2}.activityId"; $rows = $this->db->select($fileds)->from("$t1") ->join("$t2", "{$t2}.channelId={$t1}.channelId", 'left') ->join("$t3", "{$t3}.vlogId={$t1}.id", 'left') ->where($where)->order_by("{$t1}.id asc")->limit($size, 0) ->get()->result_array(); if (!$rows) { echo "不存在直播日志数据"; }else{ foreach ($rows as $key => $value) { $ac_user = $p_user = ''; $addData = [ 'vlogId' => $value['id'], 'activityId' => $value['activityId'], 'playId' => $value['playId'], 'playDuration' => $value['playDuration'], 'stayDuration' => $value['stayDuration'], 'createTime' => time() ]; $user = $this->user_model->get(['unionid'=>$value['param1']]); $user && $ac_user = $this->act_user_model->get(['activityId'=>$value['activityId'],'userId'=>$user['userId']]); if($ac_user['channelId']){ $ac_user['channelId'] && $p_user = $this->act_user_model->get(['activityId'=>$value['activityId'],'userId'=>$ac_user['channelId']]); $p_user && $addData['cfUserId'] = $p_user['userId']; $p_user['bizId'] && $addData['bizId'] = $p_user['bizId']; $p_user['levelId1'] && $addData['levelId1'] = $p_user['levelId1']; $p_user['levelId2'] && $addData['levelId2'] = $p_user['levelId2']; $p_user['levelId3'] && $addData['levelId3'] = $p_user['levelId3']; } $user && $addData['userId'] = $user['userId']; $this->market_sylive_viewlog_model->add($addData); } } } //更新经销商地址 public function tem_bizinfo(){ require_once COMMPATH . '/third_party/PHPExcel/IOFactory.php'; $this->load->model('market/market_sylive_activity_bizinfo_model'); $file = FCPATH.'pdf/bizinfo.xlsx'; $reader = \PHPExcel_IOFactory::createReader('Excel2007'); // 读取 excel 文档 $PHPExcel = $reader->load($file); // 文档名称 $objWorksheet = $PHPExcel->getActiveSheet(); $rowCnt = $objWorksheet->getHighestRow(); //获取总行数 for ($i = 2; $i <= $rowCnt; $i++) { //读取内容 $areaName = $objWorksheet->getCell('A' . $i)->getValue(); $bizName = $objWorksheet->getCell('B' . $i)->getValue(); $provinceName = $objWorksheet->getCell('C' . $i)->getValue(); $cityName = $objWorksheet->getCell('D' . $i)->getValue(); $addData = [ 'activityId' => 4, 'areaName' => $areaName, 'bizName' => $bizName, 'provinceName' => $provinceName, 'cityName' => $cityName, ]; if(!$this->market_sylive_activity_bizinfo_model->count($addData)){ $addData['createTime'] = date('Y-m-d H:i:s'); $this->market_sylive_activity_bizinfo_model->add($addData); } } echo '执行结束'; } //更新黑名单 public function up_black(){ $ckey = 'SYLIVE_BLACK_MOBLIE_LIST'; $file_path = FCPATH.'../home/sylive_blacklist.txt'; $redis = &load_cache('redis'); $redis->delete($ckey); $mobile_list = []; if (file_exists($file_path)) { $content_arr = file($file_path); foreach ($content_arr as $item) { $mobile_list[] = trim($item); } } $redis->save($ckey,$mobile_list,2*24*60*60); echo "更新成功,黑名单列表:".json_encode($mobile_list,JSON_UNESCAPED_UNICODE); } public function kpi(){ $this->load->model('market/market_sylive_activity_kpidata_model','mdSytActivityKpiData'); $this->load->model('market/market_sylive_order_model','order_model'); $this->load->model('market/market_sylive_activity_user_model', 'act_user_model'); $this->load->model('market/market_sylive_groups_user_model', 'groups_user_model'); $this->load->model('market/market_sylive_subscribemsg_model', 'mdSytSubscribemsg'); $page = $this->input->get('page'); $size = $this->input->get('size'); !$page && $page = 1; !$size && $size = 20; $where = [ 'activityId' => 6, 'id<=' => 91939, 'pid>' => 0, "pid != channelId" => null ]; $rows = $this->act_user_model->select($where,'id desc',$page,$size); if($rows){ foreach ($rows as $key => $val) { //查找是否是管理员 $group_user = $this->groups_user_model->get(['status'=>0,'activityId'=>6,'userId'=>$val['userId']]); if($group_user){ if($group_user['userId']!=$val['channelId']){ $this->act_user_model->update(['channelId'=>$group_user['userId']],['id'=>$val['id']]); echo "管理员更新成功:{$val['id']},".json_encode(['channelId'=>$group_user['userId']])."\n"; }else{ echo "无需更新:{$val['id']}\n"; } }else{ //查找上级 $p_act_user = $this->act_user_model->get(['userId'=>$val['pid'],'activityId'=>6]); $update = []; if($p_act_user['channelId']){ $update['channelId'] = $p_act_user['channelId']; }else{ $p_act_user['groupsId'] && $update['channelId'] = $p_act_user['userId']; } if($update && $update['channelId']!=$val['channelId']){ $this->act_user_model->update($update,['id'=>$val['id']]); echo "更新成功:{$val['id']},".json_encode($update)."\n"; }else{ echo "无需更新:{$val['id']}\n"; } } } }else{ echo '执行结束'; } } public function up_order_kpi(){ $this->load->model('market/market_sylive_activity_kpidata_model','mdSytActivityKpiData'); $this->load->library('market/sylive2_entity'); $page = $this->input->get('page'); $size = $this->input->get('size'); !$page && $page = 1; !$size && $size = 20; $activityId = 6; $time_start = strtotime('2022-12-16 00:00:00'); $where = [ 'activityId' => $activityId, 'kpi' => 'order', 'createTime<' => $time_start ]; $rows = $this->mdSytActivityKpiData->select($where,'id desc',$page,$size,'id,activityId,cfUserId'); if($rows){ foreach ($rows as $key => $val) { $this->mdSytActivityKpiData->update(['kpi'=>'beforeOrder'],['id'=>$val['id']]); $val['cfUserId'] && $this->sylive2_entity->kpi_count($activityId,'beforeOrder',$val['cfUserId']); echo "执行成功:{$val['id']}\n"; } }else{ echo '执行结束'; } } public function up_kpi_count(){ $this->load->model('market/market_sylive_activity_kpidata_model','mdSytActivityKpiData'); $this->load->library('market/sylive2_entity'); $page = $this->input->get('page'); $size = $this->input->get('size'); !$page && $page = 1; !$size && $size = 20; $activityId = 6; $where = [ 'activityId' => $activityId, 'kpi' => 'order', 'id<=' => 237801 ]; $rows = $this->mdSytActivityKpiData->select($where,'id desc',$page,$size,'id,activityId,cfUserId'); if($rows){ foreach ($rows as $key => $val) { $val['cfUserId'] && $this->sylive2_entity->kpi_count($activityId,'order',$val['cfUserId']); echo "执行成功:{$val['id']}\n"; } }else{ echo '执行结束'; } } public function tmp(){ $this->load->model('market/market_sylive_customer_model'); $this->load->model('market/market_sylive_order_model'); $this->load->library('market/sylive2_entity'); $page = $this->input->get('page'); $size = $this->input->get('size'); !$page && $page = 1; !$size && $size = 20; $where = [ 'activityId' => 9, ]; $rows = $this->market_sylive_customer_model->select($where,'customerId asc',$page,$size); if($rows){ foreach ($rows as $key => $val) { $order = $this->market_sylive_order_model->get(['userId'=>$val['userId'],'activityId'=>9,'itemId'=>12]); if($order){ //添加kpi $params = ['a_id' => 9, 'uid' => $val['userId'],'cf_uid' => $val['cfUserId'], 'kpi' => 'beforeOrder']; $params['tagId'] = $order['id']; $params['itemId'] = 12; $params['jsondata'] = [ 'sid' => $order['sid'], 'order_id' => $order['id'] ]; $params['c_time'] = strtotime($order['createTime']); $this->sylive2_entity->kpi_log($params); } } echo '执行完毕'; }else{ echo '执行结束'; } } public function thApi(){ require_once COMMPATH . 'third_party/SytApi.php'; $this->load->model('market/market_sylive_user_model', 'user_model'); $this->load->model('market/market_sylive_order_model'); $this->load->model('market/market_sylive_groups_user_model', 'groups_user_model'); $this->load->model('market/market_sylive_groups_model', 'groups_model'); $this->load->model('market/market_sylive_organization_model'); $page = $this->input->get('page'); $size = $this->input->get('size'); !$page && $page=1; !$size && $size=40; $where = [ "activityId" => 11, "itemId" => 18, "areaId" =>0 ]; $count = $this->market_sylive_order_model->count($where); if($count>0){ $rows = $this->market_sylive_order_model->select($where,'id asc',$page,$size); $syt = new SytApi(); foreach ($rows as $key => $val) { $gwUser = $this->user_model->get(['userId'=>$val["cfUserId"]]); $dlrCode = "79968V"; $mediaCaName = ""; $leadNo = $val["userId"]; //获取意向网点编码 if($gwUser){ $mediaCaName = $gwUser['uname']; $group_user = $this->groups_user_model->get(['activityId' => $val["activityId"], 'userId' => $val['cfUserId'], 'status' => 0]); $group = $this->groups_model->get(["groupsId" => $group_user["groupsId"]]); $biz = $this->market_sylive_organization_model->get(['organizationId'=>$group['originalBizId']]); $biz["comments"] && $dlrCode = $biz['comments']; } $syt->Tj($dlrCode,"活动客户",$val["mobile"],$mediaCaName,$leadNo); $this->market_sylive_order_model->update(["areaId"=>1],["id"=>$val["id"]]); sleep(1); } echo "剩余:".$count-$size; }else{ echo "无需执行"; } } //获取发送第三方报文 public function get_sendInfo(){ require_once COMMPATH . 'third_party/SytApi.php'; $this->load->model('market/market_sylive_user_model', 'user_model'); $this->load->model('market/market_sylive_order_model'); $this->load->model('market/market_sylive_groups_user_model', 'groups_user_model'); $this->load->model('market/market_sylive_groups_model', 'groups_model'); $this->load->model('market/market_sylive_organization_model'); $id = $this->input->get('id'); $where = [ "activityId" => 11, "itemId" => 18, "id" => $id, ]; $row = $this->market_sylive_order_model->get($where); if($row){ $gwUser = $this->user_model->get(['userId'=>$row["cfUserId"]]); $dlrCode = "79968V"; $mediaCaName = ""; $leadNo = $row["userId"]; //获取意向网点编码 if($gwUser){ $mediaCaName = $gwUser['uname']; $group_user = $this->groups_user_model->get(['activityId' => $row["activityId"], 'userId' => $row['cfUserId'], 'status' => 0]); $group = $this->groups_model->get(["groupsId" => $group_user["groupsId"]]); $biz = $this->market_sylive_organization_model->get(['organizationId'=>$group['originalBizId']]); $biz["comments"] && $dlrCode = $biz['comments']; } $syt = new SytApi(); $req = $syt->Bw($dlrCode,"活动客户",$row["mobile"],$mediaCaName,$leadNo); echo $req; }else{ echo "订单不存在"; } } //根据订单生成kpi数据 public function add_kpidata(){ $this->load->model('market/market_sylive_activity_user_model', 'act_user_model'); $this->load->model('market/market_sylive_order_model'); $this->load->library('market/sylive2_entity'); $this->load->model('market/market_sylive_user_model', 'user_model'); $this->load->model('market/market_sylive_activity_user_model', 'act_user_model'); $this->load->model('market/market_sylive_groups_model', 'groups_model'); $this->load->model('market/market_sylive_groups_user_model', 'groups_user_model'); $this->load->model('market/market_sys_dictionary_data_model'); $this->load->model('market/market_sylive_activity_kpidata_model','mdSytActivityKpiData'); $page = $this->input->get('page'); $size = $this->input->get('size'); !$page && $page=1; !$size && $size=30; $where = [ "activityId" => 11, "itemId" => 19, ]; $rows = $this->market_sylive_order_model->select($where,'id desc',$page,$size); if($rows){ $count = $this->market_sylive_order_model->count($where); foreach ($rows as $key => $order) { if($order['cfUserId']){ $re_kpi = $this->mdSytActivityKpiData->count(array("activityId" => $order['activityId'], 'tagId' => $order['id'], 'kpi' => 'order')); if($re_kpi){ //kpi存在 $res = "订单kpi数据已存在"; }else{ //增加记录 $addData = [ 'activityId' => $order['activityId'], 'userId' => $order['userId'], 'cfUserId' => $order['cfUserId'], 'kpi' => 'order', ]; $addData['createTime'] = strtotime($order['createTime']); $addData['updateTime'] = date('Y-m-d H:i:s',$addData['createTime']); $addData['day'] = date('Y-m-d',$addData['createTime']); $addData['bizId'] = $order['bizId']; $addData['levelId1'] = $order['levelId1']; $addData['levelId2'] = $order['levelId2']; $addData['levelId3'] = $order['levelId3']; $addData['tagId'] = $order['id']; $addData['itemId'] = $order['itemId']; $jsondata = ['order_id'=>$order['id'],'sid'=>$order['sid']]; $addData['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE); $id = $this->mdSytActivityKpiData->add($addData); if (!$id) { $res = "添加记录失败"; }else{ $this->sylive2_entity->kpi_count($order['activityId'],"order",$order["cfUserId"]); $res = "添加记录成功"; } } }else{ $res = "无需添加cfUserId=0"; } echo "订单id-{$order['id']},kpi结果:{$res}
\n"; } echo "剩余:".($count-$size*$page); }else{ echo "执行完毕"; } } }