|
|
@@ -169,13 +169,19 @@ class IndexController extends BaseController
|
|
|
*/
|
|
|
public function calendar(){
|
|
|
$apiUrl = env('FOLI_API');
|
|
|
+ $type = request()->get('type', 0);
|
|
|
if(empty($apiUrl)){
|
|
|
return message('获取失败', false);
|
|
|
}
|
|
|
|
|
|
- $content = file_get_contents($apiUrl.'/foli/'.date('Y').'/'.date('m'));
|
|
|
- $temp = substr($content,strpos($content, '<div class="furborder">'));
|
|
|
- $temp = substr($temp, 0, strpos($temp, '<div class="calendar mt">'));
|
|
|
+ $content = '';
|
|
|
+ $temp = '';
|
|
|
+ if($type == 0){
|
|
|
+ $content = file_get_contents($apiUrl.'/foli/'.date('Y').'/'.date('m'));
|
|
|
+ $temp = substr($content,strpos($content, '<div class="furborder">'));
|
|
|
+ $temp = substr($temp, 0, strpos($temp, '<div class="calendar mt">'));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// 宜忌
|
|
|
$content1 = file_get_contents($apiUrl.'/laohuangli/');
|
|
|
@@ -185,8 +191,10 @@ class IndexController extends BaseController
|
|
|
$yi = isset($yi[1])? $yi[1] : '';
|
|
|
preg_match("/<td colspan=\"3\">(.*)<\/td>/", $temp1, $ji);
|
|
|
$ji = isset($ji[1])? $ji[1] : '';
|
|
|
+ preg_match("/<td class>(.*)<\/td>/", $temp1, $yl);
|
|
|
+ $yl = isset($yl[1])? $yl[1] : '';
|
|
|
|
|
|
- return message(MESSAGE_OK, true, ['content'=> $content, 'result'=> $temp,'yj'=> $temp1,'yi'=> $yi,'ji'=> $ji]);
|
|
|
+ return message(MESSAGE_OK, true, ['content'=> $content, 'result'=> $temp,'date'=> date('m月d日'),'yl'=> $yl,'yi'=> $yi,'ji'=> $ji]);
|
|
|
|
|
|
}
|
|
|
}
|