webman/app/controller/api/CommonController.php

90 lines
2.3 KiB
PHP
Raw Normal View History

2025-02-16 00:28:13 +08:00
<?php
namespace app\controller\api;
use support\Request;
use App\Utils\ApiResponseApp;
use App\model\Dictionary;
2025-02-17 09:39:17 +08:00
use App\model\ExchangeRate;
2025-02-16 00:28:13 +08:00
use hg\apidoc\annotation as Apidoc;
use support\Db;
/**
* @Apidoc\Title("公共控制器?")
*/
class CommonController
{
protected $noNeedLogin = ['config', 'get_project', 'get_projectdetailed', 'get_mechanism_list'];
/**
* @Apidoc\Title("1.0 获取全局配置")
* @Apidoc\Url("api/common/config")
* @Apidoc\Method("POST")
*/
public function config(Request $request)
{
$Dictionary=Dictionary::all();
$res=[];
2025-02-17 09:39:17 +08:00
$ExchangeRate = ExchangeRate::all();
2025-02-16 00:28:13 +08:00
$res = [
"account_notice" => "Log in to link account and get 300 to 3,000 random points a day",
2025-02-17 09:39:17 +08:00
// "vi_rate" => "2.49",
// "trx_rate" => "0.00",
// "nrly_rate" => "30",
// "trx_rate1" => "",
// "inr_rate" => "1.62",
// "php_rate" => null,
// "brl_rate" => "0.10",
2025-02-16 00:28:13 +08:00
"brl_fee" => "300",
"pkr_fee" => "300",
2025-02-17 09:39:17 +08:00
// "pkr_rate" => "5",
2025-02-16 00:28:13 +08:00
"pkr_min" => "2000",
"brl_min" => "5000"
];
2025-02-17 09:39:17 +08:00
foreach ($ExchangeRate as $item) {
$res[strtolower($item['type']) . '_rate'] = $item['points'];
}
2025-02-16 00:28:13 +08:00
$col=['service_1','service_2','service_3','service_url','service_user_url','points'];
foreach($Dictionary as $key=>$value){
$res[$value->key]=$value->value;
}
return ApiResponseApp::success($res);
}
/**
* @Apidoc\Title("1.0 消息根据type 判断类型")
* @Apidoc\Url("api/common/messageList")
* 3是首页弹窗 1是消息中心
* {
"data": [
{
"id": 2,
"title": "Announcement",
"content": "<p><img src=\"https://112233job.com/uploads/20250120/039faa1fb225ef5814a325218f2e00ee.jpg\" data-filename=\"filename\" style=\"width: 277.516px; height: 275.69px;\"><br></p>",
"status": 1,
"createtime": 1737370611,
"updatetime": 0,
"status_text": "Status 1"
}
],
"total": 0
}
2025-02-16 00:28:13 +08:00
* @Apidoc\Method("POST")
*/
public function messageList(Request $request){
$type=$request->get('type');
/**
* 返回轮播图
*/
if($type==5){
}
}
}