@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | $this->getHttp(); |
| 393 | 393 | if ($this->where['type'] === 'sites') { |
| 394 | 394 | $this->getDataWithOrderOpt(); |
| 395 | - } else { |
|
| 395 | + }else { |
|
| 396 | 396 | $this->getDataWithCount(); |
| 397 | 397 | } |
| 398 | 398 | if (empty($this->backtrack)) { |
@@ -421,8 +421,8 @@ discard block |
||
| 421 | 421 | throw new DtaException('请检查panel参数'); |
| 422 | 422 | } |
| 423 | 423 | //定义cookie保存位置 |
| 424 | - $file = app()->getRootPath() . 'runtime/dtapp/bt/cookie/'; |
|
| 425 | - $cookie_file = $file . md5($this->panel) . '.cookie'; |
|
| 424 | + $file = app()->getRootPath().'runtime/dtapp/bt/cookie/'; |
|
| 425 | + $cookie_file = $file.md5($this->panel).'.cookie'; |
|
| 426 | 426 | if (empty(Files::judgeContents($file)) && !mkdir($file, 0777, true) && !is_dir($file)) { |
| 427 | 427 | throw new \RuntimeException(sprintf('Directory "%s" was not created', $file)); |
| 428 | 428 | } |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | { |
| 455 | 455 | $start = strpos($str, "共"); |
| 456 | 456 | $end = strpos($str, "条数据"); |
| 457 | - $count = substr($str, $start + 3, $end - $start - 3); |
|
| 457 | + $count = substr($str, $start+3, $end-$start-3); |
|
| 458 | 458 | if (empty($count)) { |
| 459 | 459 | return 0; |
| 460 | 460 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $sign = $this->createSign(); |
| 146 | 146 | //组织参数 |
| 147 | 147 | $strParam = $this->createStrParam(); |
| 148 | - $strParam .= 'sign=' . $sign; |
|
| 148 | + $strParam .= 'sign='.$sign; |
|
| 149 | 149 | //访问服务 |
| 150 | 150 | $result = file_get_contents("{$this->url}?{$strParam}"); |
| 151 | 151 | $result = json_decode($result, true); |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | $this->params['sign_method'] = $this->sign_method; |
| 352 | 352 | $this->params['param_json'] = json_encode($this->param, JSON_UNESCAPED_UNICODE); |
| 353 | 353 | $this->http(); |
| 354 | - $response = Strings::replace('.', '_', $this->method) . "_response"; |
|
| 354 | + $response = Strings::replace('.', '_', $this->method)."_response"; |
|
| 355 | 355 | if (isset($this->output[$response]['result'])) { |
| 356 | 356 | if (is_array($this->output[$response]['result'])) { |
| 357 | 357 | return $this->output[$response]['result']; |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | ksort($this->params); |
| 389 | 389 | foreach ($this->params as $key => $val) { |
| 390 | 390 | if ($key !== '' && $val !== '') { |
| 391 | - $sign .= $key . $val; |
|
| 391 | + $sign .= $key.$val; |
|
| 392 | 392 | } |
| 393 | 393 | } |
| 394 | 394 | $sign .= $this->secret_key; |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | $strParam = ''; |
| 406 | 406 | foreach ($this->params as $key => $val) { |
| 407 | 407 | if ($key !== '' && $val !== '') { |
| 408 | - $strParam .= $key . '=' . urlencode($val) . '&'; |
|
| 408 | + $strParam .= $key.'='.urlencode($val).'&'; |
|
| 409 | 409 | } |
| 410 | 410 | } |
| 411 | 411 | return $strParam; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | private function http(): self |
| 142 | 142 | { |
| 143 | 143 | $ch = curl_init(); |
| 144 | - curl_setopt($ch, CURLOPT_URL, $this->panel . $this->url); |
|
| 144 | + curl_setopt($ch, CURLOPT_URL, $this->panel.$this->url); |
|
| 145 | 145 | curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); |
| 146 | 146 | curl_setopt($ch, CURLOPT_POST, 1); |
| 147 | 147 | curl_setopt($ch, CURLOPT_POSTFIELDS, array_merge($this->getKeyData(), $this->data)); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | { |
| 166 | 166 | $time = time(); |
| 167 | 167 | return array( |
| 168 | - 'request_token' => md5($time . '' . md5($this->key)), |
|
| 168 | + 'request_token' => md5($time.''.md5($this->key)), |
|
| 169 | 169 | 'request_time' => $time |
| 170 | 170 | ); |
| 171 | 171 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | { |
| 70 | 70 | if (is_array($str)) { |
| 71 | 71 | $this->data = json_encode($str, JSON_UNESCAPED_UNICODE); |
| 72 | - } else { |
|
| 72 | + }else { |
|
| 73 | 73 | $this->data = $str; |
| 74 | 74 | } |
| 75 | 75 | return $this; |
@@ -165,13 +165,13 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | if ($this->method === 'GET') { |
| 167 | 167 | $this->httpGet(); |
| 168 | - } else if ($this->method === 'POST') { |
|
| 168 | + }else if ($this->method === 'POST') { |
|
| 169 | 169 | $this->httpPost(); |
| 170 | - } else if ($this->method === 'XML') { |
|
| 170 | + }else if ($this->method === 'XML') { |
|
| 171 | 171 | $this->httpXml(); |
| 172 | - } else if ($this->method === 'FILE') { |
|
| 172 | + }else if ($this->method === 'FILE') { |
|
| 173 | 173 | $this->httpFile(); |
| 174 | - } else { |
|
| 174 | + }else { |
|
| 175 | 175 | throw new HttpException(404, '请求方式异常'); |
| 176 | 176 | } |
| 177 | 177 | if (empty($is)) { |
@@ -213,12 +213,12 @@ discard block |
||
| 213 | 213 | { |
| 214 | 214 | $ch = curl_init(); |
| 215 | 215 | curl_setopt($ch, CURLOPT_URL, $this->url); |
| 216 | - curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: ' . $this->headers)); |
|
| 216 | + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: '.$this->headers)); |
|
| 217 | 217 | curl_setopt($ch, CURLOPT_HEADER, 0); |
| 218 | 218 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 219 | 219 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
| 220 | 220 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查 |
| 221 | - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查SSL加密算法是否存在 |
|
| 221 | + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查SSL加密算法是否存在 |
|
| 222 | 222 | curl_setopt($ch, CURLOPT_POST, 1); |
| 223 | 223 | curl_setopt($ch, CURLOPT_POSTFIELDS, $this->data); |
| 224 | 224 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | curl_setopt($ch, CURLOPT_TIMEOUT, 40); |
| 255 | 255 | set_time_limit(0); |
| 256 | 256 | if (!empty($this->headers)) { |
| 257 | - curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: ' . $this->headers)); |
|
| 257 | + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: '.$this->headers)); |
|
| 258 | 258 | } |
| 259 | 259 | //运行curl |
| 260 | 260 | $data = curl_exec($ch); |
@@ -281,17 +281,17 @@ discard block |
||
| 281 | 281 | curl_setopt($ch, CURLOPT_SSLKEYTYPE, 'PEM'); |
| 282 | 282 | curl_setopt($ch, CURLOPT_SSLCERT, $this->cert['cert']); |
| 283 | 283 | curl_setopt($ch, CURLOPT_SSLKEY, $this->cert['key']); |
| 284 | - } else if (strpos($this->url, 'https') === 0) { |
|
| 284 | + }else if (strpos($this->url, 'https') === 0) { |
|
| 285 | 285 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 信任任何证书 |
| 286 | 286 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // 检查证书中是否设置域名 |
| 287 | 287 | } |
| 288 | 288 | if (!empty($this->headers)) { |
| 289 | - curl_setopt($ch, CURLOPT_HTTPHEADER, array('content-type: ' . $this->headers)); |
|
| 289 | + curl_setopt($ch, CURLOPT_HTTPHEADER, array('content-type: '.$this->headers)); |
|
| 290 | 290 | } |
| 291 | - curl_setopt($ch, CURLOPT_HEADER, true); // 是否需要响应 header |
|
| 291 | + curl_setopt($ch, CURLOPT_HEADER, true); // 是否需要响应 header |
|
| 292 | 292 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 293 | 293 | $output = curl_exec($ch); |
| 294 | - $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); // 获得响应结果里的:头大小 |
|
| 294 | + $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); // 获得响应结果里的:头大小 |
|
| 295 | 295 | $response_body = substr($output, $header_size); |
| 296 | 296 | curl_close($ch); |
| 297 | 297 | $this->output = $response_body; |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $this->scope = $scope; |
| 175 | 175 | } elseif ($scope === "snsapi_userinfo") { |
| 176 | 176 | $this->scope = $scope; |
| 177 | - } else { |
|
| 177 | + }else { |
|
| 178 | 178 | throw new DtaException("请检查scope参数"); |
| 179 | 179 | } |
| 180 | 180 | return $this; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | // 获取数据 |
| 325 | 325 | $accessToken = $this->getAccessToken(); |
| 326 | 326 | if (!isset($accessToken['access_token'])) { |
| 327 | - throw new DtaException("获取access_token错误," . $accessToken['errmsg']); |
|
| 327 | + throw new DtaException("获取access_token错误,".$accessToken['errmsg']); |
|
| 328 | 328 | } |
| 329 | 329 | $res = HttpService::instance() |
| 330 | 330 | ->url("https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token={$accessToken['access_token']}&type=jsapi") |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | // 获取数据 |
| 334 | 334 | $accessToken = $this->getAccessToken(); |
| 335 | 335 | if (!isset($accessToken['access_token'])) { |
| 336 | - throw new DtaException("获取access_token错误," . $accessToken['errmsg']); |
|
| 336 | + throw new DtaException("获取access_token错误,".$accessToken['errmsg']); |
|
| 337 | 337 | } |
| 338 | 338 | $res = HttpService::instance() |
| 339 | 339 | ->url("https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token={$accessToken['access_token']}&type=jsapi") |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; |
| 374 | 374 | $str = ""; |
| 375 | 375 | for ($i = 0; $i < $length; $i++) { |
| 376 | - $str .= $chars[random_int(0, strlen($chars) - 1)]; |
|
| 376 | + $str .= $chars[random_int(0, strlen($chars)-1)]; |
|
| 377 | 377 | } |
| 378 | 378 | return $str; |
| 379 | 379 | } |
@@ -645,22 +645,22 @@ discard block |
||
| 645 | 645 | $accessToken_res = HttpService::instance() |
| 646 | 646 | ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}") |
| 647 | 647 | ->toArray(); |
| 648 | - $accessToken_res['expires_time'] = time() + 6000; |
|
| 648 | + $accessToken_res['expires_time'] = time()+6000; |
|
| 649 | 649 | file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE)); |
| 650 | 650 | $accessToken = $accessToken_res; |
| 651 | - } else if (!isset($accessToken['access_token'])) { |
|
| 651 | + }else if (!isset($accessToken['access_token'])) { |
|
| 652 | 652 | // 内容不存在 |
| 653 | 653 | $accessToken_res = HttpService::instance() |
| 654 | 654 | ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}") |
| 655 | 655 | ->toArray(); |
| 656 | - $accessToken_res['expires_time'] = time() + 6000; |
|
| 656 | + $accessToken_res['expires_time'] = time()+6000; |
|
| 657 | 657 | file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE)); |
| 658 | 658 | $accessToken = $accessToken_res; |
| 659 | - } else if ($accessToken['expires_time'] <= time()) { |
|
| 659 | + }else if ($accessToken['expires_time'] <= time()) { |
|
| 660 | 660 | $accessToken_res = HttpService::instance() |
| 661 | 661 | ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}") |
| 662 | 662 | ->toArray(); |
| 663 | - $accessToken_res['expires_time'] = time() + 6000; |
|
| 663 | + $accessToken_res['expires_time'] = time()+6000; |
|
| 664 | 664 | file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE)); |
| 665 | 665 | $accessToken = $accessToken_res; |
| 666 | 666 | } |
@@ -672,15 +672,15 @@ discard block |
||
| 672 | 672 | $accessToken_res = HttpService::instance() |
| 673 | 673 | ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}") |
| 674 | 674 | ->toArray(); |
| 675 | - $accessToken_res['expires_time'] = time() + 6000; |
|
| 675 | + $accessToken_res['expires_time'] = time()+6000; |
|
| 676 | 676 | file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE)); |
| 677 | 677 | $accessToken = $accessToken_res; |
| 678 | 678 | } |
| 679 | - } else { |
|
| 679 | + }else { |
|
| 680 | 680 | $accessToken_res = HttpService::instance() |
| 681 | 681 | ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}") |
| 682 | 682 | ->toArray(); |
| 683 | - $accessToken_res['expires_time'] = time() + 6000; |
|
| 683 | + $accessToken_res['expires_time'] = time()+6000; |
|
| 684 | 684 | file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE)); |
| 685 | 685 | $accessToken = $accessToken_res; |
| 686 | 686 | } |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | $cache_mysql_value = dtacache($file); |
| 696 | 696 | if (!empty($cache_mysql_value)) { |
| 697 | 697 | $access_token['access_token'] = $cache_mysql_value; |
| 698 | - } else { |
|
| 698 | + }else { |
|
| 699 | 699 | // 获取远程Token |
| 700 | 700 | $accessToken_res = HttpService::instance() |
| 701 | 701 | ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}") |
@@ -767,11 +767,11 @@ discard block |
||
| 767 | 767 | // 转成字符串 |
| 768 | 768 | $stringA = Urls::toParams($array); |
| 769 | 769 | // 在字符串接商户支付秘钥 |
| 770 | - $stringSignTemp = "{$stringA}&key=" . $this->mch_key; |
|
| 770 | + $stringSignTemp = "{$stringA}&key=".$this->mch_key; |
|
| 771 | 771 | //步骤四:MD5或HMAC-SHA256C加密 |
| 772 | 772 | if ($hmacsha256) { |
| 773 | 773 | $str = hash_hmac("sha256", $stringSignTemp, $this->mch_key); |
| 774 | - } else { |
|
| 774 | + }else { |
|
| 775 | 775 | $str = md5($stringSignTemp); |
| 776 | 776 | } |
| 777 | 777 | //符转大写 |
@@ -795,8 +795,8 @@ discard block |
||
| 795 | 795 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); |
| 796 | 796 | |
| 797 | 797 | //试试手气新增,增加之后 curl 不报 60# 错误,可以请求到微信的响应 |
| 798 | - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //不验证 SSL 证书 |
|
| 799 | - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);//不验证 SSL 证书域名 |
|
| 798 | + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //不验证 SSL 证书 |
|
| 799 | + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //不验证 SSL 证书域名 |
|
| 800 | 800 | //post提交方式 |
| 801 | 801 | curl_setopt($ch, CURLOPT_POST, TRUE); |
| 802 | 802 | curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); |
@@ -810,6 +810,6 @@ discard block |
||
| 810 | 810 | |
| 811 | 811 | $error = curl_errno($ch); |
| 812 | 812 | curl_close($ch); |
| 813 | - return "curl error, error code " . $error; |
|
| 813 | + return "curl error, error code ".$error; |
|
| 814 | 814 | } |
| 815 | 815 | } |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | $data['msgtype'] = $this->msgType; |
| 100 | 100 | } |
| 101 | 101 | $result = HttpService::instance() |
| 102 | - ->url("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=" . $this->key) |
|
| 102 | + ->url("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=".$this->key) |
|
| 103 | 103 | ->data($data) |
| 104 | 104 | ->toArray(); |
| 105 | 105 | return $result['errcode'] === 0; |
@@ -427,21 +427,21 @@ discard block |
||
| 427 | 427 | $accessToken_res = HttpService::instance() |
| 428 | 428 | ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}") |
| 429 | 429 | ->toArray(); |
| 430 | - $accessToken_res['expires_time'] = time() + 6000; |
|
| 430 | + $accessToken_res['expires_time'] = time()+6000; |
|
| 431 | 431 | file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE)); |
| 432 | 432 | $accessToken = $accessToken_res; |
| 433 | - } else if (!isset($accessToken['access_token'])) { |
|
| 433 | + }else if (!isset($accessToken['access_token'])) { |
|
| 434 | 434 | $accessToken_res = HttpService::instance() |
| 435 | 435 | ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}") |
| 436 | 436 | ->toArray(); |
| 437 | - $accessToken_res['expires_time'] = time() + 6000; |
|
| 437 | + $accessToken_res['expires_time'] = time()+6000; |
|
| 438 | 438 | file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE)); |
| 439 | 439 | $accessToken = $accessToken_res; |
| 440 | - } else if ($accessToken['expires_time'] <= time()) { |
|
| 440 | + }else if ($accessToken['expires_time'] <= time()) { |
|
| 441 | 441 | $accessToken_res = HttpService::instance() |
| 442 | 442 | ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}") |
| 443 | 443 | ->toArray(); |
| 444 | - $accessToken_res['expires_time'] = time() + 6000; |
|
| 444 | + $accessToken_res['expires_time'] = time()+6000; |
|
| 445 | 445 | file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE)); |
| 446 | 446 | $accessToken = $accessToken_res; |
| 447 | 447 | } |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | $cache_mysql_value = dtacache($file); |
| 457 | 457 | if (!empty($cache_mysql_value)) { |
| 458 | 458 | $access_token['access_token'] = $cache_mysql_value; |
| 459 | - } else { |
|
| 459 | + }else { |
|
| 460 | 460 | $accessToken_res = HttpService::instance() |
| 461 | 461 | ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}") |
| 462 | 462 | ->toArray(); |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | $sign = $this->createSign(); |
| 126 | 126 | //组织参数 |
| 127 | 127 | $strParam = $this->createStrParam(); |
| 128 | - $strParam .= 'sign=' . $sign; |
|
| 128 | + $strParam .= 'sign='.$sign; |
|
| 129 | 129 | //访问服务 |
| 130 | - $url = "{$this->url}?" . $strParam; |
|
| 130 | + $url = "{$this->url}?".$strParam; |
|
| 131 | 131 | $result = file_get_contents($url); |
| 132 | 132 | $result = json_decode($result, true); |
| 133 | 133 | $this->output = $result; |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | { |
| 518 | 518 | if (is_object($object)) { |
| 519 | 519 | $arr = (array)($object); |
| 520 | - } else { |
|
| 520 | + }else { |
|
| 521 | 521 | $arr = &$object; |
| 522 | 522 | } |
| 523 | 523 | if (is_array($arr)) { |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | ksort($this->param); |
| 546 | 546 | foreach ($this->param as $key => $val) { |
| 547 | 547 | if ($key !== '' && $val !== '') { |
| 548 | - $sign .= $key . $val; |
|
| 548 | + $sign .= $key.$val; |
|
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | $sign .= $this->client_secret; |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | $strParam = ''; |
| 563 | 563 | foreach ($this->param as $key => $val) { |
| 564 | 564 | if ($key !== '' && $val !== '' && !is_array($val)) { |
| 565 | - $strParam .= $key . '=' . urlencode($val) . '&'; |
|
| 565 | + $strParam .= $key.'='.urlencode($val).'&'; |
|
| 566 | 566 | } |
| 567 | 567 | } |
| 568 | 568 | return $strParam; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library |
| 18 | 18 | // +---------------------------------------------------------------------- |
| 19 | 19 | |
| 20 | -declare (strict_types=1); |
|
| 20 | +declare(strict_types=1); |
|
| 21 | 21 | |
| 22 | 22 | namespace DtApp\ThinkLibrary\helper; |
| 23 | 23 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | date_default_timezone_set('Asia/Shanghai'); |
| 59 | 59 | $msec = 0; |
| 60 | 60 | list($msec, $sec) = explode(' ', microtime()); |
| 61 | - return (float)sprintf('%.0f', ((float)$msec + (float)$sec) * 1000); |
|
| 61 | + return (float)sprintf('%.0f', ((float)$msec+(float)$sec)*1000); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | date_default_timezone_set('Asia/Shanghai'); |
| 73 | 73 | $end_time = strtotime($end_time); |
| 74 | 74 | $start_time = $start_time === '' ? time() : strtotime($start_time); |
| 75 | - return $end_time - $start_time; |
|
| 75 | + return $end_time-$start_time; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | if (empty($time)) { |
| 112 | 112 | $time = time(); |
| 113 | 113 | } |
| 114 | - return date($format, $time - $mun); |
|
| 114 | + return date($format, $time-$mun); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | if (empty($time)) { |
| 128 | 128 | $time = time(); |
| 129 | 129 | } |
| 130 | - return date($format, $time + $mun); |
|
| 130 | + return date($format, $time+$mun); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | { |
| 142 | 142 | date_default_timezone_set('Asia/Shanghai'); |
| 143 | 143 | $date = date('H:i'); |
| 144 | - $curTime = strtotime($date);//当前时分 |
|
| 145 | - $assignTime1 = strtotime($start);//获得指定分钟时间戳,00:00 |
|
| 146 | - $assignTime2 = strtotime($end);//获得指定分钟时间戳,01:00 |
|
| 144 | + $curTime = strtotime($date); //当前时分 |
|
| 145 | + $assignTime1 = strtotime($start); //获得指定分钟时间戳,00:00 |
|
| 146 | + $assignTime2 = strtotime($end); //获得指定分钟时间戳,01:00 |
|
| 147 | 147 | $result = false; |
| 148 | 148 | if ($curTime > $assignTime1 && $curTime < $assignTime2) { |
| 149 | 149 | $result = true; |