UserCard.php 1.9 KB

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