添加:封坛酒及油卡额度记录
This commit is contained in:
parent
55d903947e
commit
a3daf45832
|
|
@ -22,6 +22,11 @@ class RecordDao extends BaseDao{
|
|||
->when(isset($params['id']) && $params['id'] !== '',function($query) use ($params){
|
||||
$query->where('id', (int)$params['id']);
|
||||
})
|
||||
->with([
|
||||
'user' => function($query){
|
||||
$query->field('uid,nickname,avatar');
|
||||
}
|
||||
])
|
||||
->order('create_time DESC,id DESC');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class ExchangeQuotaRecordDao extends BaseDao{
|
|||
*/
|
||||
public function searchModel(array $params){
|
||||
$quotaType = $params['quota_type'] ?? 1;// 存在指定类型则使用指定类型,否则使用默认类型(默认酒卡)
|
||||
$quotaType = in_array((int)$quotaType,[1,2]) ? $quotaType : 1;// 类型非法,使用默认类型
|
||||
$quotaType = in_array((int)$quotaType,[1,2,3,4]) ? $quotaType : 1;// 类型非法,使用默认类型
|
||||
|
||||
return (new ExchangeQuotaRecord())
|
||||
->where('quota_type', $quotaType)
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
namespace app\common\model\marketing\activity;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
use app\common\model\user\User;
|
||||
|
||||
class Record extends BaseModel{
|
||||
|
||||
|
||||
public static function tablePk():string{
|
||||
return 'id';
|
||||
}
|
||||
|
|
@ -17,6 +16,9 @@ class Record extends BaseModel{
|
|||
|
||||
|
||||
|
||||
public function user(){
|
||||
return $this->hasOne(User::class, 'uid', 'uid');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
namespace app\controller\admin\marketing\activity;
|
||||
|
||||
|
||||
use app\common\repositories\marketing\activity\RecordRepository;
|
||||
use crmeb\basic\BaseController;
|
||||
use think\App;
|
||||
|
||||
class Record extends BaseController{
|
||||
|
||||
protected $repository;
|
||||
|
||||
public function __construct(App $app, RecordRepository $repository){
|
||||
parent::__construct($app);
|
||||
$this->repository = $repository;
|
||||
}
|
||||
/**
|
||||
* Common: 活动参与记录列表
|
||||
* Author: wu-hui
|
||||
* Time: 2024/03/14 20:36
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getList(){
|
||||
[$page, $limit] = $this->getPage();
|
||||
$params = $this->request->params(['title']);
|
||||
$data = $this->repository->getList((array)$params,(int)$page,(int)$limit);
|
||||
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -512,7 +512,7 @@ Route::group(function () {
|
|||
Route::post('cate/delInfo','.Cate/delInfo')->name('systemMarketingActivityCateDel')->option([
|
||||
'_alias' => '删除分类',
|
||||
]);
|
||||
// 活动列表
|
||||
// 活动
|
||||
Route::get('list','.Activity/getList')->name('systemMarketingActivityList')->option([
|
||||
'_alias' => '活动列表',
|
||||
]);
|
||||
|
|
@ -525,7 +525,10 @@ Route::group(function () {
|
|||
Route::post('delInfo','.Activity/delInfo')->name('systemMarketingActivityDel')->option([
|
||||
'_alias' => '删除活动',
|
||||
]);
|
||||
|
||||
// 活动参与记录
|
||||
Route::get('record/list','.Record/getList')->name('systemMarketingActivityList')->option([
|
||||
'_alias' => '活动参加记录列表',
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue