12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace app\admin\controller\auth;
- class Userdelrecentreadcount extends UserDetailBase
- {
- public function _initialize()
- {
- parent::_initialize();
- }
- public function index()
- {
- if ($this->request->isAjax()) {
- list($where, $sort, $order, $offset, $limit) = $this->buildparams();
- $data = $this->userRecentlyReadModel->setConnect($this->ids)
- ->where(['user_id' => $this->ids, 'flag' => 0])
- ->where($where)
- ->limit($offset, $limit)
- ->order('updatetime desc')
- ->select();
- $total = $this->userRecentlyReadModel->setConnect($this->ids)
- ->where(['user_id' => $this->ids, 'flag' => 0])
- ->where($where)
- ->count();
- if($data){
- foreach ($data as $key => $item)
- {
- $bookName = model('Book')->where(['id'=>$item['book_id']])->find();
- if($bookName){
- $data[$key]['bookname'] = $bookName->name;
- }else{
- $data[$key]['bookname'] = '未知';
- }
- $data[$key]['updatetime'] = date('Y-m-d H:i:s', $item['updatetime']);
- }
- }
- $result = array("total" => $total, "rows" => $data);
- return json($result);
- }
- $this->view->assign('title', '已删除阅读记录');
- $this->view->assign('type', 'userdelrecentreadcount');
- return $this->view->fetch();
- }
- }
|