Sellerlog.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. *
  8. * ============================================================================
  9. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  10. * 网站地址: https://www.valimart.net/
  11. * ----------------------------------------------------------------------------
  12. *
  13. * ============================================================================
  14. * 控制器
  15. */
  16. class Sellerlog extends BaseSeller {
  17. public function initialize() {
  18. parent::initialize(); // TODO: Change the autogenerated stub
  19. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/sellerlog.lang.php');
  20. }
  21. public function log_list() {
  22. $sellerlog_model = model('sellerlog');
  23. $condition = array();
  24. $condition[] = array('sellerlog_store_id', '=', session('store_id'));
  25. $seller_name = input('seller_name');
  26. $log_content = input('log_content');
  27. $add_time_from = input('add_time_from');
  28. $add_time_to = input('add_time_to');
  29. if (!empty($seller_name)) {
  30. $condition[] = array('sellerlog_seller_name', 'like', '%' . input('seller_name') . '%');
  31. }
  32. if (!empty($log_content)) {
  33. $condition[] = array('sellerlog_content', 'like', '%' . $log_content . '%');
  34. }
  35. if (!empty($add_time_from)) {
  36. $condition[] = array('sellerlog_time', '>=', strtotime($add_time_from));
  37. }
  38. if (!empty($add_time_to)) {
  39. $condition[] = array('sellerlog_time', '<=', strtotime($add_time_to)+86399);
  40. }
  41. $log_list = $sellerlog_model->getSellerlogList($condition, 10, 'sellerlog_id desc');
  42. View::assign('log_list', $log_list);
  43. View::assign('show_page', $sellerlog_model->page_info->render());
  44. /* 设置卖家当前菜单 */
  45. $this->setSellerCurMenu('sellerlog');
  46. /* 设置卖家当前栏目 */
  47. $this->setSellerCurItem('log_list');
  48. return View::fetch($this->template_dir . 'seller_log');
  49. }
  50. /**
  51. * 用户中心右边,小导航
  52. *
  53. * @param string $menu_key 当前导航
  54. * @return
  55. */
  56. public function getSellerItemList() {
  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. }