Order.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\admin\controller;
  3. use think\Validate;
  4. use think\Lang;
  5. class Order extends AdminControl
  6. {
  7. public function _initialize()
  8. {
  9. parent::_initialize();
  10. Lang::load(APP_PATH . 'admin/lang/' . config('default_lang') . '/order.lang.php');
  11. }
  12. /**
  13. * 用户列表
  14. * @return mixed
  15. */
  16. public function index()
  17. {
  18. $model_order = Model('Order');
  19. $order_identity = input('order_identity', '');
  20. $user_id = intval(input('user_id', 0));
  21. $product_id = intval(input('product_id', 0));
  22. $where = [];
  23. if ($order_identity != '') {
  24. $where['order_identity'] = $order_identity;
  25. }
  26. if ($user_id) {
  27. $where['user_id'] = $user_id;
  28. }
  29. if ($product_id) {
  30. $where['product_id'] = $product_id;
  31. }
  32. $order_list = $model_order->getOrdList($where, '*', 10);
  33. $this->assign('order_list', $order_list);
  34. $this->assign('show_page', $order_list->render());
  35. $this->setAdminCurItem('index');
  36. $this->assign('oinput', ['order_identity' => input("order_identity",''), 'user_id' => input("user_id",''), 'product_id' => input("product_id","")]);
  37. return $this->fetch();
  38. }
  39. }