You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
954 B
PHTML
41 lines
954 B
PHTML
5 years ago
|
<?php
|
||
|
/**
|
||
|
* Created by PhpStorm.
|
||
|
* User: xmy 280564871@qq.com
|
||
|
* Date: 2017/4/1
|
||
|
* Time: 15:41
|
||
|
*/
|
||
|
|
||
|
namespace Admin\Model;
|
||
|
|
||
|
class PointRecordModel extends TabModel {
|
||
|
|
||
|
protected $_auto = [
|
||
|
['create_time','time',self::MODEL_BOTH,'function'],
|
||
|
];
|
||
|
|
||
|
|
||
|
public function getLists($map="",$order="create_time desc",$p=1){
|
||
|
$page = intval($p);
|
||
|
$page = $page ? $page : 1; //默认显示第一页数据
|
||
|
|
||
|
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
|
||
|
|
||
|
$data['data'] = $this
|
||
|
->table("tab_point_record as pr")
|
||
|
->field("pr.*,u.account,pt.name")
|
||
|
->where($map)
|
||
|
->join("tab_user u on u.id=pr.user_id")
|
||
|
->join("tab_point_type pt on pr.type_id = pt.id")
|
||
|
->order($order)
|
||
|
->page($page,$row)
|
||
|
->select();
|
||
|
$data['count'] = $this
|
||
|
->table("tab_point_record as pr")
|
||
|
->where($map)
|
||
|
->join("tab_user u on u.id=pr.user_id")
|
||
|
->join("tab_point_type pt on pr.type_id = pt.id")
|
||
|
->count();
|
||
|
return $data;
|
||
|
}
|
||
|
}
|