|
|
@@ -21,60 +21,71 @@ class TestController extends webApp
|
|
|
return message(1002, true, $key);
|
|
|
}
|
|
|
|
|
|
- public function betList1()
|
|
|
+ public function betList()
|
|
|
{
|
|
|
- //第一步:获取cookie
|
|
|
- $cookieFile = ROOT_PATH . '/public/cookie.tmp';
|
|
|
- $url = 'http://86524391-jf.for9dong.com/login';
|
|
|
- $data = array(
|
|
|
- 'type' => 2,
|
|
|
- 'account' => 'xxcc666',
|
|
|
- 'password' => 'AAbb1122',
|
|
|
- 'code' => '6497',
|
|
|
- 'facode' => '',
|
|
|
- );
|
|
|
- //curl初始化
|
|
|
- $ch = curl_init();
|
|
|
- curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
- //设置为post请求
|
|
|
- curl_setopt($ch, CURLOPT_POST, true);
|
|
|
- //设置附带返回header信息为空
|
|
|
- curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
- //post数据
|
|
|
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
|
|
- //cookie保存文件位置
|
|
|
- curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile);
|
|
|
- //设置数据返回作为变量储存,而不是直接输出
|
|
|
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
- //执行请求
|
|
|
- $ret = curl_exec($ch);
|
|
|
- var_dump($ret);
|
|
|
- //关闭连接
|
|
|
- curl_close($ch);
|
|
|
-
|
|
|
- //第二步:附带cookie请求需要登陆的页面
|
|
|
- $url = 'https://86524391-jf.for9dong.com/agent/report/list?detail=true&begin=2023-02-28&end=2023-02-28&settle=true&lottery=PK10JSC';
|
|
|
-
|
|
|
- //curl初始化
|
|
|
- $ch = curl_init();
|
|
|
- curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
- //设置为post请求
|
|
|
- curl_setopt($ch, CURLOPT_POST, true);
|
|
|
- //设置附带返回header信息为空
|
|
|
- curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
- //设置cookie信息文件位置, 注意与第二步中的获取不同,这里是读取
|
|
|
- curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile);
|
|
|
- //设置数据返回作为变量储存,而不是直接输出
|
|
|
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
- //执行请求
|
|
|
- $ret = curl_exec($ch);
|
|
|
-
|
|
|
- var_dump($ret);
|
|
|
- //关闭连接
|
|
|
- curl_close($ch);
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * 东郲
|
|
|
+ * 213808.app
|
|
|
+ * 661182FF
|
|
|
+ * xxcc666
|
|
|
+ * AAbb1122
|
|
|
+ */
|
|
|
+
|
|
|
+ set_time_limit(0);
|
|
|
+ $cookie = 'ssid1=ac7aeb26742b7642d45a0605d4749266; random=549; token=f06742d5c5d6f66606d86bc28f279f12a3d831fa';
|
|
|
+ $url = 'https://86524391-jf.for9dong.com/agent/report/bets?username=bnm368&lottery=PK10JSC&begin=2023-02-28&end=2023-02-28&settle=true';
|
|
|
+ $header = ["Cookie: ssid1=a6d82ef49895683ce8789c1ef0141163; random=9338; token=e11c72348bc5f0b654957495154f6dbaff1307d7","User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","Host: 86524391-jf.for9dong.com","Connection: keep-alive","Referer: https://86524391-jf.for9dong.com/agent/report/list?username=yyy1999&lottery=PK10JSC&detail=true&begin=2023-02-28&end=2023-02-28&settle=true"];
|
|
|
+
|
|
|
+ $page = request('page');
|
|
|
+// $html = grabRequest($url.'&page='.$page, $header, '', 'get', 'text', '',10);
|
|
|
+//var_dump($html);
|
|
|
+// return 0;
|
|
|
+ $pageNum = 2730;
|
|
|
+ $endPage = 50;
|
|
|
+ $datas = [];
|
|
|
+ $page = request('page');
|
|
|
+ $endPage = request('endPage');
|
|
|
+ for($i = $page; $i<=$endPage;){
|
|
|
+ $html = grabRequest($url.'&page='.$i, $header, '', 'get', 'text', '',10);
|
|
|
+ $queryList = QueryList::html($html)->rules([
|
|
|
+ 'order_sn'=> ['td>a:eq(0)','text'],
|
|
|
+ 'time'=> ['td:eq(1)','text'],
|
|
|
+ 'gameName'=> ['td.period','html','-div'],
|
|
|
+ 'period'=> ['td.period>div','text'],
|
|
|
+ 'account'=> ['td:eq(3)','html','-div'],
|
|
|
+ 'region'=> ['td:eq(3)>div','text'],
|
|
|
+ 'code'=> ['td>span:eq(0)','text'],
|
|
|
+ 'odds'=> ['.odds','text'],
|
|
|
+ 'money'=> ['.money','text'],
|
|
|
+ 'commission'=> ['.commission','text'],
|
|
|
+ 'result'=> ['.dividend','text'],
|
|
|
+ 'share'=> ['.share','text'],
|
|
|
+ 'result1'=> ['td:eq(9)','text'],
|
|
|
+ ])->range('tr')->query()->getData();
|
|
|
+
|
|
|
+ $queryList = $queryList->all();
|
|
|
+ if($queryList){
|
|
|
+ foreach ($queryList as $item ){
|
|
|
+ if($item['order_sn'] && !DB::table('test_logs')->where(['order_sn'=> $item['order_sn'],'page'=> $i])->value('id')){
|
|
|
+ $item['page'] = $i;
|
|
|
+ $item['money'] = floatval($item['money']);
|
|
|
+ $item['code'] = str_replace(['『','』'],['[',']'], $item['code']);
|
|
|
+ $datas[] = $item;
|
|
|
+ //RedisService::set('order:'.$item['order_sn'], 11, 60000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $i++;
|
|
|
+ }
|
|
|
+
|
|
|
+ DB::table('test_logs')->insert($datas);
|
|
|
+
|
|
|
+ return message(1002, true, $datas);
|
|
|
}
|
|
|
|
|
|
- public function betList()
|
|
|
+ public function betList1()
|
|
|
{
|
|
|
/**
|
|
|
*
|
|
|
@@ -87,7 +98,7 @@ class TestController extends webApp
|
|
|
|
|
|
set_time_limit(0);
|
|
|
$cookie = 'ssid1=ac7aeb26742b7642d45a0605d4749266; random=549; token=f06742d5c5d6f66606d86bc28f279f12a3d831fa';
|
|
|
- $url = 'https://86524391-jf.for9dong.com/agent/report/bets?username=bnm368&lottery=PK10JSC&begin=2023-02-28&end=2023-02-28&settle=true';
|
|
|
+ $url = 'https://86524391-jf.for9dong.com/agent/report/bets?username=jkl338&lottery=PK10JSC&begin=2023-02-28&end=2023-02-28&settle=true';
|
|
|
$header = ["Cookie: ssid1=a6d82ef49895683ce8789c1ef0141163; random=9338; token=e11c72348bc5f0b654957495154f6dbaff1307d7","User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","Host: 86524391-jf.for9dong.com","Connection: keep-alive","Referer: https://86524391-jf.for9dong.com/agent/report/list?username=yyy1999&lottery=PK10JSC&detail=true&begin=2023-02-28&end=2023-02-28&settle=true"];
|
|
|
|
|
|
$page = request('page');
|
|
|
@@ -137,4 +148,11 @@ class TestController extends webApp
|
|
|
|
|
|
return message(1002, true, $datas);
|
|
|
}
|
|
|
+
|
|
|
+ public function export()
|
|
|
+ {
|
|
|
+ $account = 'bnm368';
|
|
|
+ $datas = DB::table('test_logs')->where(['account'=> $account])->get();
|
|
|
+ return message(1002, true, $datas);
|
|
|
+ }
|
|
|
}
|