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