Files
digital_doctor/digital_doctor/application/api/controller/Power.php
2024-07-10 17:40:31 +08:00

54 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*
* description
* authorwh
* email
* createTime{2024/6/22} {15:02}
*/
namespace app\api\controller;
use app\common\model\TabConf;
use think\Db;
use wanghua\general_utility_tools_php\Mmodel;
use wanghua\general_utility_tools_php\SundryConfig;
use wanghua\general_utility_tools_php\tool\Tools;
class Power extends BaseHttpApi
{
/**
* desc当前用户消耗体力
*
* api/Power/cutPower
*
* 参数:
* num 消耗体力 默认1
*
* authorwh
*/
function cutPower()
{
return Mmodel::catchJson(function (){
$openid = api_user_openid();
$num = input('num',1);
Db::table(TabConf::$fa_users)
->where('openid',$openid)
->setDec('power',$num);
return Tools::set_ok('ok');
});
}
/**
* desc获取体力上限配置
* api/Power/getPowerLimitConfig
* authorwh
*/
function getPowerLimitConfig(){
return Mmodel::catchJson(function (){
$power_limit_config = SundryConfig::val('power_limit_config');
return Tools::set_ok('ok',$power_limit_config);
});
}
}