Order.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace app\admin\controller\company;
  3. use app\admin\controller\AuthController;
  4. use app\admin\model\order\StoreOrder as StoreOrderModel;
  5. use app\models\system\SystemStore;
  6. use app\admin\model\store\{
  7. StoreDescription,
  8. StoreProductAttrValue,
  9. StoreProductAttr,
  10. StoreProductAttrResult,
  11. StoreProductCate,
  12. StoreProductRelation,
  13. StoreCategory as CategoryModel,
  14. StoreProduct as ProductModel
  15. };
  16. use app\admin\model\ump\StoreBargain;
  17. use app\admin\model\ump\StoreCombination;
  18. use app\admin\model\ump\StoreSeckill;
  19. use crmeb\services\{JsonService, JsonService as Json, UtilService as Util, FormBuilder as Form};
  20. use crmeb\traits\CurdControllerTrait;
  21. use think\facade\Route as Url;
  22. use app\admin\model\system\{
  23. SystemAttachment, ShippingTemplates
  24. };
  25. /**
  26. * 产品管理
  27. * Class StoreProduct
  28. * @package app\admin\controller\store
  29. */
  30. class Order extends AuthController
  31. {
  32. use CurdControllerTrait;
  33. protected $bindModel = ProductModel::class;
  34. /**
  35. * @return mixed
  36. */
  37. public function index()
  38. {
  39. $this->assign([
  40. 'year' => get_month(),
  41. 'real_name' => $this->request->get('real_name', ''),
  42. 'status' => $this->request->param('status', ''),
  43. 'orderCount' => StoreOrderModel::orderCount($this->adminInfo['store_id']),
  44. 'payTypeCount' => StoreOrderModel::payTypeCount($this->adminInfo['store_id']),
  45. ]);
  46. $this->assign('type', $this->adminInfo['type']);
  47. if ($this->adminInfo['type'] == 0) {
  48. $this->assign('store', SystemStore::where('is_show', 1)->where('is_del', 0)->field('id,name')->select());
  49. }
  50. $this->assign('store_id', $this->adminInfo['store_id']);
  51. return $this->fetch();
  52. }
  53. /**
  54. * 获取头部订单金额等信息
  55. * return json
  56. */
  57. public function getBadge()
  58. {
  59. $where = Util::postMore([
  60. ['status', ''],
  61. ['real_name', ''],
  62. ['is_del', 0],
  63. ['data', ''],
  64. ['type', ''],
  65. ['pay_type', ''],
  66. ['order', ''],
  67. ]);
  68. $where['store_id'] = $this->adminInfo['store_id'];
  69. if ($this->request->post('store_id') > 0) $where['store_id'] = $this->request->post('store_id');
  70. return Json::successful(StoreOrderModel::getBadge($where));
  71. }
  72. }