Sellercost.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 Sellercost extends BaseSeller
  16. {
  17. public function initialize()
  18. {
  19. parent::initialize();
  20. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/sellercost.lang.php');
  21. }
  22. public function cost_list()
  23. {
  24. $storecost_model = model('storecost');
  25. $condition = array();
  26. $condition[] = array('storecost_store_id', '=', session('store_id'));
  27. $storecost_remark = input('get.storecost_remark');
  28. if (!empty($storecost_remark)) {
  29. $condition[] = array('storecost_remark', 'like', '%' . $storecost_remark . '%');
  30. }
  31. $add_time_from = input('get.add_time_from');
  32. $add_time_to = input('get.add_time_to');
  33. if ((input('param.add_time_from')) != '') {
  34. $add_time_from = strtotime((input('param.add_time_from')));
  35. $condition[] = array('storecost_time', '>=', $add_time_from);
  36. }
  37. if ((input('param.add_time_to')) != '') {
  38. $add_time_to = strtotime((input('param.add_time_to'))) + 86399;
  39. $condition[] = array('storecost_time', '<=', $add_time_to);
  40. }
  41. $cost_list = $storecost_model->getStorecostList($condition, 10, 'storecost_id desc');
  42. View::assign('cost_list', $cost_list);
  43. View::assign('show_page', $storecost_model->page_info->render());
  44. /* 设置卖家当前菜单 */
  45. $this->setSellerCurMenu('sellercost');
  46. /* 设置卖家当前栏目 */
  47. $this->setSellerCurItem('cost_list');
  48. return View::fetch($this->template_dir . 'cost_list');
  49. }
  50. /**
  51. * 用户中心右边,小导航
  52. *
  53. * @param string $menu_type 导航类型
  54. * @param string $menu_key 当前导航的menu_key
  55. * @param array $array 附加菜单
  56. * @return
  57. */
  58. protected function getSellerItemList()
  59. {
  60. $menu_array = array(
  61. array(
  62. 'name' => 'cost_list',
  63. 'text' => lang('cost_list'),
  64. 'url' => (string)url('Sellercost/cost_list')
  65. ),
  66. );
  67. return $menu_array;
  68. }
  69. }