添加:持有积分相关接口
This commit is contained in:
parent
8a0c9cce6b
commit
bf1702b3d8
|
|
@ -132,6 +132,46 @@ class IntegralRepository extends BaseRepository
|
||||||
|
|
||||||
return compact('count','list');
|
return compact('count','list');
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Common: 获取全部持有积分信息
|
||||||
|
* Author: wu-hui
|
||||||
|
* Time: 2023/11/10 17:02
|
||||||
|
* @param int $uid
|
||||||
|
* @param int $page
|
||||||
|
* @param int $limit
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
*/
|
||||||
|
public function getAllIntegralList(array $params,int $page,int $limit):array{
|
||||||
|
$query = $this->dao->getSearch([])
|
||||||
|
->when((int)$params['uid'] > 0,function($query) use ($params){
|
||||||
|
$query->where('uid', (int)$params['uid']);
|
||||||
|
})
|
||||||
|
->when((int)$params['mer_id'] > 0,function($query) use ($params){
|
||||||
|
$query->where('mer_id', (int)$params['mer_id']);
|
||||||
|
})
|
||||||
|
->with([
|
||||||
|
'mer' => function($query){
|
||||||
|
$query->field('mer_id,mer_name,mer_avatar')->bind(['mer_name','mer_avatar']);
|
||||||
|
},
|
||||||
|
'user' => function($query){
|
||||||
|
$query->field('uid,nickname,avatar')->bind(['nickname','avatar']);
|
||||||
|
}
|
||||||
|
])
|
||||||
|
->order('create_time DESC');
|
||||||
|
$count = $query->count();
|
||||||
|
$list = $query->page($page,$limit)->select();
|
||||||
|
|
||||||
|
return compact('count','list');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ use app\common\repositories\store\ExcelRepository;
|
||||||
use app\common\repositories\system\CacheRepository;
|
use app\common\repositories\system\CacheRepository;
|
||||||
use app\common\repositories\system\config\ConfigClassifyRepository;
|
use app\common\repositories\system\config\ConfigClassifyRepository;
|
||||||
use app\common\repositories\system\config\ConfigValueRepository;
|
use app\common\repositories\system\config\ConfigValueRepository;
|
||||||
|
use app\common\repositories\user\IntegralRepository;
|
||||||
use app\common\repositories\user\UserBillRepository;
|
use app\common\repositories\user\UserBillRepository;
|
||||||
use app\validate\admin\IntegralConfigValidate;
|
use app\validate\admin\IntegralConfigValidate;
|
||||||
use crmeb\basic\BaseController;
|
use crmeb\basic\BaseController;
|
||||||
|
|
@ -88,4 +89,20 @@ class UserIntegral extends BaseController
|
||||||
app()->make(ConfigValueRepository::class)->save($cid, $config, 0);
|
app()->make(ConfigValueRepository::class)->save($cid, $config, 0);
|
||||||
return app('json')->success('保存成功');
|
return app('json')->success('保存成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 持有积分列表
|
||||||
|
public function holdIntegral(){
|
||||||
|
[$page, $limit] = $this->getPage();
|
||||||
|
$params = $this->request->params(['uid','mer_id']);
|
||||||
|
|
||||||
|
$data = app()->make(IntegralRepository::class)->getAllIntegralList((array)$params,(int)$page,(int)$limit);
|
||||||
|
|
||||||
|
return app('json')->success($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,20 @@ Route::group(function () {
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Route::group('user/integral', function () {
|
||||||
|
Route::get('hold_list', '.UserIntegral/holdIntegral')->name('systemUserIntegralHoldList')->option([
|
||||||
|
'_alias' => '持有积分',
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})->prefix('admin.user')->option([
|
||||||
|
'_path' => '/marketing/integral/hold',
|
||||||
|
'_auth' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//预售商品
|
//预售商品
|
||||||
Route::group('store/product/presell', function () {
|
Route::group('store/product/presell', function () {
|
||||||
Route::get('lst', 'StoreProductPresell/lst')->name('systemStoreProductPresellLst')->option([
|
Route::get('lst', 'StoreProductPresell/lst')->name('systemStoreProductPresellLst')->option([
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue