SellerLogController.class.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace Seller\Controller;
  3. use Admin\Model\StatisticsModel;
  4. class SellerLogController extends CommonController {
  5. protected function _initialize(){
  6. parent::_initialize();
  7. }
  8. public function index(){
  9. $_GPC = I('request.');
  10. $pindex = max(1, intval($_GPC['page']));
  11. $psize = 20;
  12. $condition = ' ';
  13. $this->gpc = $_GPC;
  14. if ($_GPC['type'] != '') {
  15. $condition .= ' and l.type =' . intval($_GPC['type']);
  16. }
  17. if (!empty($_GPC['s_uname'])) {
  18. $condition .= ' and s.s_uname like "%'.$_GPC['s_uname'].'%" ';
  19. }
  20. $list = M()->query('SELECT l.*,s.s_uname FROM ' . C('DB_PREFIX') . 'seller_log as l
  21. left join '.C('DB_PREFIX') .'seller as s on s.s_id = l.s_id
  22. WHERE 1 ' .
  23. $condition . ' ORDER BY id DESC limit ' . (($pindex - 1) * $psize) . ',' . $psize);
  24. foreach($list as &$value){
  25. if($value['type'] == 1){
  26. $value['type'] = '登录平台';
  27. }else if($value['type'] == 0){
  28. $value['types'] = '退出平台';
  29. }else if($value['type'] == 2){
  30. $value['types'] = '订单操作';
  31. }else if($value['type'] == 3){
  32. $value['types'] = '商品操作';
  33. }
  34. }
  35. $total = M('seller_log l')->join( C('DB_PREFIX').'seller s on s.s_id = l.s_id ','left')->where( "1 ". $condition )->count();
  36. $pager = pagination2($total, $pindex, $psize);
  37. $this->list = $list;
  38. $this->pager = $pager;
  39. $this->display();
  40. }
  41. public function analys ()
  42. {
  43. $this->display();
  44. }
  45. }