Sellerlog.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. *
  8. * ============================================================================
  9. *
  10. * ----------------------------------------------------------------------------
  11. *
  12. * ============================================================================
  13. * 控制器
  14. */
  15. class Sellerlog extends BaseSeller
  16. {
  17. public function initialize()
  18. {
  19. parent::initialize(); // TODO: Change the autogenerated stub
  20. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/sellerlog.lang.php');
  21. }
  22. public function log_list()
  23. {
  24. $sellerlog_model = model('sellerlog');
  25. $condition = array();
  26. $condition[] = array('sellerlog_store_id', '=', session('store_id'));
  27. $seller_name = input('seller_name');
  28. $log_content = input('log_content');
  29. $add_time_from = input('add_time_from');
  30. $add_time_to = input('add_time_to');
  31. if (!empty($seller_name)) {
  32. $condition[] = array('sellerlog_seller_name', 'like', '%' . input('seller_name') . '%');
  33. }
  34. if (!empty($log_content)) {
  35. $condition[] = array('sellerlog_content', 'like', '%' . $log_content . '%');
  36. }
  37. if (!empty($add_time_from)) {
  38. $condition[] = array('sellerlog_time', '>=', strtotime($add_time_from));
  39. }
  40. if (!empty($add_time_to)) {
  41. $condition[] = array('sellerlog_time', '<=', strtotime($add_time_to) + 86399);
  42. }
  43. $log_list = $sellerlog_model->getSellerlogList($condition, 10, 'sellerlog_id desc');
  44. View::assign('log_list', $log_list);
  45. View::assign('show_page', $sellerlog_model->page_info->render());
  46. /* 设置卖家当前菜单 */
  47. $this->setSellerCurMenu('sellerlog');
  48. /* 设置卖家当前栏目 */
  49. $this->setSellerCurItem('log_list');
  50. return View::fetch($this->template_dir . 'seller_log');
  51. }
  52. /**
  53. * 用户中心右边,小导航
  54. *
  55. * @param string $menu_key 当前导航
  56. * @return
  57. */
  58. public function getSellerItemList()
  59. {
  60. $menu_array = array();
  61. $menu_array[] = array(
  62. 'name' => 'log_list',
  63. 'text' => lang('account_log'),
  64. 'url' => (string) url('Sellerlog/log_list')
  65. );
  66. return $menu_array;
  67. }
  68. }