Files
yycea/application/api/controller/wdsxh/points/UserWechatPointsLog.php
2026-03-17 09:56:06 +08:00

59 lines
2.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | 麦沃德科技赋能开发者,助力中小企业发展
// +----------------------------------------------------------------------
// | Copyright (c) 20172024 www.wdadmin.cn All rights reserved.
// +----------------------------------------------------------------------
// | Wdadmin系统产品软件并不是自由软件不加密并不代表开源未经许可不可自由转售和商用
// +----------------------------------------------------------------------
// | Author: MY WORLD Team <bd@maiwd.cn> www.wdadmin.cn
// +----------------------------------------------------------------------
namespace app\api\controller\wdsxh\points;
use app\api\model\wdsxh\UserWechat;
use app\common\controller\Api;
class UserWechatPointsLog extends Api
{
protected $noNeedLogin = [''];
protected $noNeedRight = ['*'];
protected $model = null;
protected $wechat_id = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\common\model\wdsxh\points\UserWechatPointsLog();
$this->wechat_id = (new UserWechat())->where('user_id',$this->auth->id)->value('id');
}
/**
* Desc 积分明细
* Create on 2025/11/13 下午5:57
* Create by wangyafang
*/
public function index()
{
if(!$this->request->isGet()) {
$this->error('请求类型错误');
}
$param = $this->request->get();
$page = isset($param['page']) ? $param['page'] : '';
$limit = isset($param['limit']) ? $param['limit'] : 10;
$where = [];
$where['wechat_id'] = array('eq',$this->wechat_id);
if (isset($param['change']) && $param['change'] !== '') {
$where['change'] = array('eq',$param['change']);
}
$total = $this->model->where($where)->count();
$data = $this->model
->where($where)
->field('change,createtime,points,memo')
->page($page,$limit)
->order('id desc')
->select();
$this->success('请求成功',['total' => $total,'data' => $data]);
}
}