增加后台操作金额接口
This commit is contained in:
parent
a12ce6b174
commit
ffdd451b1d
|
@ -3,6 +3,7 @@
|
|||
namespace app\controller\admin\api\v1;
|
||||
|
||||
use app\dao\UserDao;
|
||||
use app\dao\UserRewardDao;
|
||||
use support\Request;
|
||||
use App\Utils\ApiResponse;
|
||||
use App\model\Admin;
|
||||
|
@ -207,4 +208,28 @@ class JobuserController
|
|||
// 返回计算结果
|
||||
return ApiResponse::success(200, $res);
|
||||
}
|
||||
/**
|
||||
* @Apidoc\Title("1.0 增减用户积分")
|
||||
* 减法传递 负数 正数增加
|
||||
* @Apidoc\Url("admin/api/v1/Jobuser/add_money")
|
||||
* @Apidoc\Method("POST")
|
||||
* @Apidoc\Param("id", type="int",require=true, desc="用户id")
|
||||
* @Apidoc\Param("money", type="int",require=true, desc="金额")
|
||||
* @Apidoc\Param("memo", type="string",require=true, desc="备注")
|
||||
*/
|
||||
public function add_money(Request $request)
|
||||
{
|
||||
// 获取请求数据
|
||||
$data = $request->post();
|
||||
///用户id
|
||||
$user_id = $data['id'];
|
||||
//金额
|
||||
$money = $data['money'];
|
||||
//备注
|
||||
$memo = $data['memo'];
|
||||
UserRewardDao::sing($user_id, 30);
|
||||
UserRewardDao::adjust($user_id, $money, $memo);
|
||||
// 返回计算结果
|
||||
return ApiResponse::success(200, []);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,13 @@ class UserRewardDao
|
|||
{
|
||||
self::base($userid, 7, $money, '签到');
|
||||
}
|
||||
/**
|
||||
* 人工调整
|
||||
*/
|
||||
public static function adjust($userid, $money,$memo)
|
||||
{
|
||||
self::base($userid, 2, $money, $memo);
|
||||
}
|
||||
/**
|
||||
* 转账函数
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue