修改查询逻辑
This commit is contained in:
parent
b679ffa226
commit
2cafc39819
@ -245,6 +245,20 @@ class UserController extends BaseApiController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function userSing()
|
||||||
|
{
|
||||||
|
(new UserValidate())->get()->goCheck('fund');
|
||||||
|
$page_no = (int)$this->request->get('page_no', 1);
|
||||||
|
$page_size = (int)$this->request->get('page_size', 15);
|
||||||
|
$params = $this->request->get();
|
||||||
|
$params['page_no'] = $page_no > 0 ? $page_no : 1;
|
||||||
|
$params['page_size'] = $page_size > 0 ? $page_size : 15;
|
||||||
|
$res = UserLogic::userSingList($params,$this->userId);
|
||||||
|
$res['page_no'] = $params['page_no'];
|
||||||
|
$res['page_size'] = $params['page_size'];
|
||||||
|
return $this->success('ok', $res);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户信息
|
* 用户信息
|
||||||
*/
|
*/
|
||||||
|
@ -5,6 +5,7 @@ namespace app\api\logic\user;
|
|||||||
|
|
||||||
use app\api\service\UserTokenService;
|
use app\api\service\UserTokenService;
|
||||||
use app\common\{logic\BaseLogic,
|
use app\common\{logic\BaseLogic,
|
||||||
|
logic\PayNotifyLogic,
|
||||||
model\dict\DictData,
|
model\dict\DictData,
|
||||||
model\finance\CapitalFlow,
|
model\finance\CapitalFlow,
|
||||||
model\store_finance_flow\StoreFinanceFlow,
|
model\store_finance_flow\StoreFinanceFlow,
|
||||||
@ -253,6 +254,48 @@ class UserLogic extends BaseLogic
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function userSingList($params,$uid)
|
||||||
|
{
|
||||||
|
switch ($params['type']){
|
||||||
|
case 1:
|
||||||
|
$query = UserSign::where(['uid'=>$uid,'type'=>1]);
|
||||||
|
if($params['mark'] == 1){
|
||||||
|
$query->where('financial_pm',1);//获得
|
||||||
|
}
|
||||||
|
if($params['mark'] == 2){
|
||||||
|
$query->where('financial_pm',0);
|
||||||
|
}
|
||||||
|
$count = $query->count();
|
||||||
|
$data =$query
|
||||||
|
->page($params['page_no'],$params['page_size'])
|
||||||
|
->order('id','desc')
|
||||||
|
->select()?->toArray();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$query = UserSign::where(['uid'=>$uid,'type'=>0]);
|
||||||
|
if($params['mark'] == 1){
|
||||||
|
$query->where('financial_pm',1);//获得
|
||||||
|
}
|
||||||
|
if($params['mark'] == 2){
|
||||||
|
$query->where('financial_pm',0);
|
||||||
|
}
|
||||||
|
$count = $query->count();
|
||||||
|
$data =$query
|
||||||
|
->page($params['page_no'],$params['page_size'])
|
||||||
|
->order('id','desc')
|
||||||
|
->select()?->toArray();
|
||||||
|
}
|
||||||
|
foreach ($data as &$value){
|
||||||
|
if(!preg_match('/[\x{4e00}-\x{9fa5}]/u', $value['title'])){
|
||||||
|
$value['title'] = PayNotifyLogic::getTitle($value['title'],$value['number']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'lists' => $data,
|
||||||
|
'count' => $count
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static function dealDetails($params,$uid)
|
public static function dealDetails($params,$uid)
|
||||||
{
|
{
|
||||||
@ -306,7 +349,7 @@ class UserLogic extends BaseLogic
|
|||||||
//礼品券明细
|
//礼品券明细
|
||||||
$query = UserSign::where(['uid'=>$uid]);
|
$query = UserSign::where(['uid'=>$uid]);
|
||||||
if($params['mark'] == 1){
|
if($params['mark'] == 1){
|
||||||
$query->where('financial_pm',1);
|
$query->where('financial_pm',1);//获得
|
||||||
}
|
}
|
||||||
if($params['mark'] == 2){
|
if($params['mark'] == 2){
|
||||||
$query->where('financial_pm',0);
|
$query->where('financial_pm',0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user