1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- namespace app\common\controller;
- trait Recharge
- {
-
- public function index()
- {
- $where = $this->request->getMore([
- ['data', ''],
- ['paid', ''],
- ['nickname', ''],
- ]);
- $where['store_id'] = 0;
- return $this->success($this->services->getRechargeList($where));
- }
-
- public function delete($id)
- {
- if (!$id) return $this->fail('缺少参数');
- return $this->success($this->services->delRecharge((int)$id) ? '删除成功' : '删除失败');
- }
-
- public function user_recharge()
- {
- $where = $this->request->getMore([
- ['data', ''],
- ['paid', ''],
- ['nickname', ''],
- ]);
- $where['store_id'] = 0;
- return $this->success($this->services->user_recharge($where));
- }
-
- public function refund_edit($id)
- {
- if (!$id) return $this->fail('数据不存在');
- return $this->success($this->services->refund_edit((int)$id));
- }
-
- public function refund_update($id)
- {
- $data = $this->request->postMore([
- 'refund_price',
- ]);
- if (!$id) return $this->fail('数据不存在');
- return $this->success($this->services->refund_update((int)$id, $data['refund_price']) ? '退款成功' : '退款失败');
- }
- }
|