CardOrder.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/11/11
  6. */
  7. namespace app\admin\controller\card;
  8. use app\admin\controller\AuthController;
  9. use crmeb\services\{ExpressService,
  10. JsonService,
  11. JsonService as Json,
  12. MiniProgramService,
  13. WechatService,
  14. FormBuilder as Form,
  15. CacheService,
  16. UtilService as Util};
  17. use Monolog\Handler\IFTTTHandler;
  18. use think\facade\Route as Url;
  19. use think\facade\Validate;
  20. Use app\admin\model\card\CardOrder as model;
  21. /**
  22. * 订单管理控制器 同一个订单表放在一个控制器
  23. * Class StoreOrder
  24. * @package app\admin\controller\store
  25. */
  26. class CardOrder extends AuthController
  27. {
  28. /**
  29. * @return mixed
  30. */
  31. public function index()
  32. {
  33. return $this->fetch();
  34. }
  35. public function list()
  36. {
  37. $where = Util::getMore([
  38. ['page', 1],
  39. ['limit', 20],
  40. ['name', ''],
  41. ['type', ''],
  42. ]);
  43. return Json::successlayui(model::list($where));
  44. }
  45. /**
  46. * 删除
  47. * @param $id
  48. * @return void
  49. * @throws \Exception
  50. */
  51. public function delete($id)
  52. {
  53. if (!$id) return Json::fail('删除失败');
  54. $model = new model;
  55. $res = model::destroy($id);
  56. if ($res){
  57. return Json::success('删除成功!');
  58. }else{
  59. return Json::fail($model->getErrorInfo());
  60. }
  61. }
  62. }