Initial commit: queue workspace
Made-with: Cursor
This commit is contained in:
61
pro_v3.5.1/app/services/user/UserWechatuserServices.php
Normal file
61
pro_v3.5.1/app/services/user/UserWechatuserServices.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?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\services\user;
|
||||
|
||||
use app\services\BaseServices;
|
||||
use app\dao\user\UserWechatUserDao;
|
||||
use think\annotation\Inject;
|
||||
|
||||
/**
|
||||
* Class UserWechatuserServices
|
||||
* @package app\services\user
|
||||
* @mixin UserWechatUserDao
|
||||
*/
|
||||
class UserWechatuserServices extends BaseServices
|
||||
{
|
||||
|
||||
/**
|
||||
* @var UserWechatUserDao
|
||||
*/
|
||||
#[Inject]
|
||||
protected UserWechatUserDao $dao;
|
||||
|
||||
/**
|
||||
* 自定义简单查询总数
|
||||
* @param array $where
|
||||
* @return int
|
||||
*/
|
||||
public function getCount(array $where): int
|
||||
{
|
||||
return $this->dao->getCount($where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂条件搜索列表
|
||||
* @param array $where
|
||||
* @param string $field
|
||||
* @return array
|
||||
*/
|
||||
public function getWhereUserList(array $where, string $field): array
|
||||
{
|
||||
[$page, $limit] = $this->getPageValue();
|
||||
$order_string = '';
|
||||
$order_arr = ['asc', 'desc'];
|
||||
if (isset($where['now_money']) && in_array($where['now_money'], $order_arr)) {
|
||||
$order_string = 'now_money ' . $where['now_money'];
|
||||
}
|
||||
$list = $this->dao->getListByModel($where, $field, $order_string, $page, $limit);
|
||||
$count = $this->dao->getCountByWhere($where);
|
||||
return [$list, $count];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user