new files
This commit is contained in:
35
pro_v3.5.1/app/dao/activity/card/CardBatchDao.php
Normal file
35
pro_v3.5.1/app/dao/activity/card/CardBatchDao.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\dao\activity\card;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\activity\card\CardBatch;
|
||||
|
||||
/**
|
||||
* 卡次表
|
||||
* Class CardBatchDao
|
||||
* @package app\dao\activity\card
|
||||
*/
|
||||
class CardBatchDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return CardBatch::class;
|
||||
}
|
||||
|
||||
}
|
||||
67
pro_v3.5.1/app/dao/activity/card/CardCodeDao.php
Normal file
67
pro_v3.5.1/app/dao/activity/card/CardCodeDao.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\dao\activity\card;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\activity\card\CardCode;
|
||||
use app\services\user\UserServices;
|
||||
|
||||
/**
|
||||
* 卡密
|
||||
* Class CardCodeDao
|
||||
* @package app\dao\activity\card
|
||||
*/
|
||||
class CardCodeDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return CardCode::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取卡密列表
|
||||
* @param array $where 查询条件
|
||||
* @param int $page 页码
|
||||
* @param int $limit 每页数量
|
||||
* @param string $order 排序
|
||||
* @return array
|
||||
*/
|
||||
public function getList($where = [], $page = 0, $limit = 0, $order = 'id desc')
|
||||
{
|
||||
return $this->search($where)
|
||||
->when(isset($where['field_key']) && $where['field_key'] && isset($where['keyword']) && $where['keyword'], function ($query) use ($where) {
|
||||
switch ($where['field_key']) {
|
||||
case 'card_number':
|
||||
$query->whereLike('card_number', "%{$where['keyword']}%");
|
||||
break;
|
||||
case 'nickname':
|
||||
$query->whereIn('uid', 'in', function ($q) use ($where) {
|
||||
$q->name('user')->whereLike('nickname', '%' . $where['keyword'] . '%')->field(['uid'])->select();
|
||||
});
|
||||
case 'uid':
|
||||
$query->where('uid', $where['keyword']);
|
||||
break;
|
||||
}
|
||||
})
|
||||
->when($page && $limit, function ($query) use ($page, $limit) {
|
||||
$query->page($page, $limit);
|
||||
})
|
||||
->order($order)->select()->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
36
pro_v3.5.1/app/dao/activity/card/CardGiftAuxiliaryDao.php
Normal file
36
pro_v3.5.1/app/dao/activity/card/CardGiftAuxiliaryDao.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\dao\activity\card;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\activity\card\CardGift;
|
||||
use app\model\activity\card\CardGiftAuxiliary;
|
||||
|
||||
/**
|
||||
* 礼品卡
|
||||
* Class CardGiftAuxiliaryDao
|
||||
* @package app\dao\activity\card
|
||||
*/
|
||||
class CardGiftAuxiliaryDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return CardGiftAuxiliary::class;
|
||||
}
|
||||
|
||||
}
|
||||
58
pro_v3.5.1/app/dao/activity/card/CardGiftDao.php
Normal file
58
pro_v3.5.1/app/dao/activity/card/CardGiftDao.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\dao\activity\card;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\activity\card\CardGift;
|
||||
|
||||
/**
|
||||
* 礼品卡
|
||||
* Class CardGiftDao
|
||||
* @package app\dao\activity\card
|
||||
*/
|
||||
class CardGiftDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return CardGift::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取礼品卡列表
|
||||
* @param array $where 查询条件
|
||||
* @param string $field 查询字段
|
||||
* @param int $page 页码
|
||||
* @param int $limit 每页数量
|
||||
* @param string $order 排序
|
||||
* @return array
|
||||
*/
|
||||
public function getList(array $where, string $field = '*', int $page = 0, int $limit = 0, string $order = '')
|
||||
{
|
||||
return $this->search($where)
|
||||
->field($field)
|
||||
->when($page && $limit, function ($query) use ($page, $limit) {
|
||||
$query->page($page, $limit);
|
||||
})
|
||||
->when($order, function ($query) use ($order) {
|
||||
$query->order($order);
|
||||
})
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
59
pro_v3.5.1/app/dao/activity/card/CardGiftRecordDao.php
Normal file
59
pro_v3.5.1/app/dao/activity/card/CardGiftRecordDao.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\dao\activity\card;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\activity\card\CardGift;
|
||||
use app\model\activity\card\CardGiftRecord;
|
||||
|
||||
/**
|
||||
* 礼品卡
|
||||
* Class CardGiftDao
|
||||
* @package app\dao\activity\card
|
||||
*/
|
||||
class CardGiftRecordDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return CardGiftRecord::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取礼品卡记录列表
|
||||
* @param array $where 查询条件
|
||||
* @param string $field 查询字段
|
||||
* @param int $page 页码
|
||||
* @param int $limit 每页数量
|
||||
* @param string $order 排序
|
||||
* @return array
|
||||
*/
|
||||
public function getList(array $where, string $field = '*', int $page = 0, int $limit = 0, string $order = '')
|
||||
{
|
||||
return $this->search($where)
|
||||
->field($field)
|
||||
->when($page && $limit, function ($query) use ($page, $limit) {
|
||||
$query->page($page, $limit);
|
||||
})
|
||||
->when($order, function ($query) use ($order) {
|
||||
$query->order($order);
|
||||
})
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user