You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/app/api/controller/Invite.php

46 lines
1.2 KiB

10 months ago
<?php
namespace app\api\controller;
use app\api\model\Invite\InviteLog;
use app\common\model\invite\InviteConfig;
use cores\exception\BaseException;
use think\db\exception\DbException;
use think\response\Json;
class Invite extends Controller
{
/**
* @notes:基本信息
* @return Json
* @throws BaseException
* @author: wanghousheng
*/
public function index(): Json
{
$info = InviteConfig::detail([], ['coupon']);
$data = [];
if ($info) {
$data['one_order_rate'] = $info['one_order_rate'];
$data['integral'] = $info['integral'];
$data['coupon_name'] = $info['coupon']['name'];
$model = new InviteLog();
$data['money'] = $model->sumMoney();
$data['count_people'] = $model->countPeople();
}
return $this->renderSuccess($data);
}
/**
* @notes:邀请记录
* @throws BaseException
* @throws DbException
* @author: wanghousheng
*/
public function getList(): Json
{
$model = new InviteLog();
$list = $model->getList();
return $this->renderSuccess(compact('list'));
}
}