Recharge.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\controller\store\order;
  12. use app\common\controller\Recharge as CommonRecharge;
  13. use app\controller\store\AuthController;
  14. use app\services\user\UserRechargeServices;
  15. use think\facade\App;
  16. /**
  17. * 充值
  18. * Class Recharge
  19. * @package app\controller\store\order
  20. */
  21. class Recharge extends AuthController
  22. {
  23. use CommonRecharge;
  24. /**
  25. * @var UserRechargeServices
  26. */
  27. protected $services;
  28. /**
  29. * Order constructor.
  30. * @param App $app
  31. * @param UserRechargeServices $services
  32. */
  33. public function __construct(App $app, UserRechargeServices $services)
  34. {
  35. parent::__construct($app);
  36. $this->services = $services;
  37. }
  38. /**
  39. * @return mixed
  40. */
  41. public function index()
  42. {
  43. $where = $this->request->getMore([
  44. ['data', ''],
  45. ['paid', 1],
  46. ['staff_id', ''],
  47. ]);
  48. $where['nickname'] = $this->request->param('nickname', '');
  49. $where['store_id'] = $this->storeId;
  50. return $this->success($this->services->getRechargeList($where, '*', 0, ['staff']));
  51. }
  52. /**
  53. * 获取备注
  54. * @param $id
  55. * @return mixed
  56. */
  57. public function getRemark($id)
  58. {
  59. return $this->success(['remarks' => $this->services->value(['id' => $id], 'remarks')]);
  60. }
  61. /**
  62. * @param $id
  63. * @return mixed
  64. */
  65. public function remarks($id)
  66. {
  67. $data = $this->request->param('remarks', '');
  68. $this->services->update(['id' => $id], ['remarks' => $data]);
  69. return $this->success('备注提交成功');
  70. }
  71. }