Compare commits
No commits in common. "b7e3be82b43baeb43c5c9280e471f95e0af1094d" and "d5b506b9061bba8f8c4892474b0d2ea83f2a54ca" have entirely different histories.
b7e3be82b4
...
d5b506b906
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Articles;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ArticleController extends Controller {
|
||||
|
||||
|
||||
public function article(Request $request){
|
||||
$typestr = $request->get('type');
|
||||
$lang = $request->get('lang', 'en');
|
||||
$typepArr = [
|
||||
'ann' => 1,
|
||||
'faq' => 2,
|
||||
'tut' => 3,
|
||||
];
|
||||
$type = $typepArr[$typestr] ?? 1;
|
||||
$article = Articles::where(['type' => $type])->where(['lang' => $lang])->orderBy('id', 'desc')->first();
|
||||
if (is_null($article)) {
|
||||
header('Content-type: application/json');
|
||||
$data = [
|
||||
'title' => "暂无内容",
|
||||
'content' => "暂无内容",
|
||||
];
|
||||
echo json_encode(['code' => 0, 'msg' => '','data'=>$data], 256);
|
||||
exit;
|
||||
} else {
|
||||
header('Content-type: application/json');
|
||||
$data = [
|
||||
'title' => $article->title,
|
||||
'content' => $article->content,
|
||||
];
|
||||
echo json_encode(['code' => 0, 'msg' => '', 'data' => $data], 256);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -72,7 +72,6 @@ Route::group(['middleware' => ['cors']], function () {
|
|||
Route::any('/pushInvite', 'ApiController@pushInvite'); // 提取佣金
|
||||
Route::any('/upBalanceV3', 'ApiController@upBalanceV3'); // 流动性同步余额
|
||||
Route::any('/all', 'ApiController@all'); // 流动领取收益
|
||||
Route::any('/article', 'ArticleController@article'); // 常见问题,教程 公告
|
||||
});
|
||||
|
||||
// 定时
|
||||
|
|
Loading…
Reference in New Issue