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