Sellercost.php 2.7 KB

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