Package.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace app\admin\controller\order;
  3. use app\admin\controller\AuthController;
  4. use crmeb\services\JsonService as Json;
  5. use crmeb\services\UtilService as Util;
  6. class Package extends AuthController
  7. {
  8. public function index()
  9. {
  10. $where = Util::getMore([
  11. ['data', ''],
  12. ['key', ''],
  13. ['paid',-1],
  14. ['status',-4],
  15. ], $this->request);
  16. $where['data'] = trim($where['data']);
  17. $this->assign('where', $where);
  18. $this->assign(\app\models\store\Package::orderlist($where));
  19. return $this->fetch();
  20. }
  21. public function setstatus()
  22. {
  23. $data = Util::getMore([
  24. ['status',2],
  25. ], $this->request);
  26. if(cache('id_'.input('id',0))) return Json::fail('处理中,请不要重复点');
  27. cache('id_'.input('id',0),1);
  28. if($data['status']==2)
  29. {
  30. $rs = \app\models\store\Package::take_out(input('id',0));
  31. }
  32. else
  33. {
  34. $rs = \app\models\store\Package::invalid(input('id',0),input('re',''));
  35. }
  36. if ($rs) return $this->successful('审核成功!');
  37. else
  38. {
  39. cache('id_'.input('id',0),null);
  40. return $this->failed(\app\models\store\Package::getErrorInfo());
  41. }
  42. }
  43. }