112 lines
3.0 KiB
PHP
112 lines
3.0 KiB
PHP
<?php
|
|
|
|
|
|
|
|
|
|
namespace app\controller\merchant\user;
|
|
|
|
|
|
use app\common\repositories\store\coupon\StoreCouponUserRepository;
|
|
use app\common\repositories\store\order\StoreOrderRepository;
|
|
use app\common\repositories\user\IntegralGiveRecordRepository;
|
|
use app\common\repositories\user\IntegralRepository;
|
|
use app\common\repositories\user\UserBillRepository;
|
|
use app\common\repositories\user\UserLabelRepository;
|
|
use app\common\repositories\user\UserMerchantRepository;
|
|
use crmeb\basic\BaseController;
|
|
use FormBuilder\Exception\FormBuilderException;
|
|
use think\App;
|
|
use think\db\exception\DataNotFoundException;
|
|
use think\db\exception\DbException;
|
|
use think\db\exception\ModelNotFoundException;
|
|
|
|
/**
|
|
* Class UserMerchant
|
|
* @package app\controller\merchant\user
|
|
* @author xaboy
|
|
* @day 2020/10/20
|
|
*/
|
|
class UserIntegral extends BaseController
|
|
{
|
|
protected $repository;
|
|
|
|
public function __construct(App $app, UserBillRepository $repository)
|
|
{
|
|
parent::__construct($app);
|
|
$this->repository = $repository;
|
|
}
|
|
|
|
/**
|
|
* TODO 积分日志
|
|
* @return \think\response\Json
|
|
* @author Qinii
|
|
* @day 6/9/21
|
|
*/
|
|
public function getList()
|
|
{
|
|
[$page, $limit] = $this->getPage();
|
|
$where = $this->request->params(['keyword', 'date']);
|
|
$where['category'] = 'mer_integral';
|
|
$where['mer_id'] = $this->request->merId();
|
|
return app('json')->success($this->repository->getList($where, $page, $limit));
|
|
}
|
|
|
|
/**
|
|
* TODO
|
|
* @return \think\response\Json
|
|
* @author Qinii
|
|
* @day 6/9/21
|
|
*/
|
|
public function getTitle()
|
|
{
|
|
return app('json')->success($this->repository->getStat($this->request->merId()));
|
|
}
|
|
|
|
|
|
/**
|
|
* Common: 获取赠送积分记录
|
|
* Author: wu-hui
|
|
* Time: 2023/11/14 10:52
|
|
* @return mixed
|
|
*/
|
|
public function giveRecord(){
|
|
$params = $this->request->params(['operate_uid','uid']);
|
|
$params['mer_id'] = $this->request->merId();
|
|
[$page, $limit] = $this->getPage();
|
|
|
|
$data = app()->make(IntegralGiveRecordRepository::class)->getGiveRecord((array)$params,(int)$page,(int)$limit);
|
|
|
|
return app('json')->success($data);
|
|
}
|
|
/**
|
|
* Common: 持有积分列表
|
|
* Author: wu-hui
|
|
* Time: 2023/11/18 13:51
|
|
* @return mixed
|
|
*/
|
|
public function holdList(){
|
|
[$page, $limit] = $this->getPage();
|
|
$params = $this->request->params(['uid']);
|
|
$params['mer_id'] = $this->request->merId();
|
|
|
|
$data = app()->make(IntegralRepository::class)->getAllIntegralList((array)$params,(int)$page,(int)$limit);
|
|
|
|
return app('json')->success($data);
|
|
}
|
|
/**
|
|
* Common: 持有积分统计
|
|
* Author: wu-hui
|
|
* Time: 2023/11/18 14:00
|
|
* @return mixed
|
|
*/
|
|
public function holdListTitle(){
|
|
$params = $this->request->params(['uid']);
|
|
$params['mer_id'] = $this->request->merId();
|
|
|
|
$data = app()->make(IntegralRepository::class)->getStat((array)$params);
|
|
|
|
return app('json')->success($data);
|
|
}
|
|
|
|
}
|