-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8,253 changed files
with
88,687 additions
and
88,688 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
0
public/clientarea/language/zh-cn.js → 10.2.2.version
100755 → 100644
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
612 changes: 306 additions & 306 deletions
612
app/admin/controller/ClientController.php → ...app/admin/controller/ClientController.php
100755 → 100644
Large diffs are not rendered by default.
Oops, something went wrong.
252 changes: 126 additions & 126 deletions
252
...min/controller/ClientCreditController.php → ...min/controller/ClientCreditController.php
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,127 +1,127 @@ | ||
<?php | ||
namespace app\admin\controller; | ||
|
||
use app\common\model\ClientCreditModel; | ||
use app\admin\validate\ClientCreditValidate; | ||
use app\common\model\OrderTmpModel; | ||
|
||
/** | ||
* @title 用户余额管理 | ||
* @desc 用户余额管理 | ||
* @use app\admin\controller\ClientCreditController | ||
*/ | ||
class ClientCreditController extends AdminBaseController | ||
{ | ||
public function initialize() | ||
{ | ||
parent::initialize(); | ||
$this->validate = new ClientCreditValidate(); | ||
} | ||
|
||
/** | ||
* 时间 2022-05-11 | ||
* @title 用户余额变更记录列表 | ||
* @desc 用户余额变更记录列表 | ||
* @author theworld | ||
* @version v1 | ||
* @url /admin/v1/client/:id/credit | ||
* @method GET | ||
* @param int start_time - 开始时间,时间戳(s) | ||
* @param int end_time - 结束时间,时间戳(s) | ||
* @param string type - 类型:人工Artificial,充值Recharge,应用至订单Applied,超付Overpayment,少付Underpayment,退款Refund | ||
* @param int id - 用户ID required | ||
* @param int order_id - 订单ID | ||
* @param int page - 页数 | ||
* @param int limit - 每页条数 | ||
* @return array list - 记录 | ||
* @return int list[].id - 记录ID | ||
* @return string list[].type - 类型:人工Artificial,充值Recharge,应用至订单Applied,超付Overpayment,少付Underpayment,退款Refund,提现Withdraw | ||
* @return string list[].amount - 金额 | ||
* @return string list[].notes - 备注 | ||
* @return int list[].create_time - 变更时间 | ||
* @return int list[].admin_id - 管理员ID | ||
* @return string list[].admin_name - 管理员名称 | ||
* @return int count - 记录总数 | ||
*/ | ||
public function clientCreditList() | ||
{ | ||
// 合并分页参数 | ||
$param = array_merge($this->request->param(), ['page' => $this->request->page, 'limit' => $this->request->limit, 'sort' => $this->request->sort]); | ||
|
||
// 实例化模型类 | ||
$ClientCreditModel = new ClientCreditModel(); | ||
|
||
// 获取记录 | ||
$data = $ClientCreditModel->clientCreditList($param); | ||
|
||
$result = [ | ||
'status' => 200, | ||
'msg' => lang('success_message'), | ||
'data' => $data | ||
]; | ||
return json($result); | ||
} | ||
|
||
/** | ||
* 时间 2022-05-11 | ||
* @title 更改用户余额 | ||
* @desc 更改用户余额 | ||
* @author theworld | ||
* @version v1 | ||
* @url /admin/v1/client/:id/credit | ||
* @method PUT | ||
* @param int id - 用户ID required | ||
* @param string type - 类型recharge充值deduction扣费 required | ||
* @param float amount - 金额 required | ||
* @param string notes - 备注 | ||
*/ | ||
public function update() | ||
{ | ||
// 接收参数 | ||
$param = $this->request->param(); | ||
|
||
// 参数验证 | ||
if (!$this->validate->scene('update')->check($param)){ | ||
return json(['status' => 400 , 'msg' => lang($this->validate->getError())]); | ||
} | ||
|
||
// 实例化模型类 | ||
$ClientCreditModel = new ClientCreditModel(); | ||
|
||
// 计算当前余额,小于0则报错 | ||
if($param['type']=='deduction' && $param['amount']>0){ | ||
$param['amount'] = -$param['amount']; | ||
} | ||
$param['type'] = 'Artificial'; | ||
|
||
// 修改余额 | ||
$result = $ClientCreditModel->updateClientCredit($param); | ||
|
||
return json($result); | ||
} | ||
|
||
/** | ||
* 时间 2022-05-24 | ||
* @title 充值 | ||
* @desc 充值 | ||
* @author wyh | ||
* @version v1 | ||
* @url /admin/v1/client/:id/recharge | ||
* @method post | ||
* @param int client_id 1 用户ID | ||
* @param float amount 1.00 金额 | ||
* @param string gateway WxPay 支付方式 | ||
*/ | ||
public function recharge() | ||
{ | ||
$param = $this->request->param(); | ||
|
||
$OrderTmpModel = new OrderTmpModel(); | ||
|
||
$OrderTmpModel->isAdmin = true; | ||
|
||
$result = $OrderTmpModel->recharge($param); | ||
|
||
return json($result); | ||
} | ||
<?php | ||
namespace app\admin\controller; | ||
|
||
use app\common\model\ClientCreditModel; | ||
use app\admin\validate\ClientCreditValidate; | ||
use app\common\model\OrderTmpModel; | ||
|
||
/** | ||
* @title 用户余额管理 | ||
* @desc 用户余额管理 | ||
* @use app\admin\controller\ClientCreditController | ||
*/ | ||
class ClientCreditController extends AdminBaseController | ||
{ | ||
public function initialize() | ||
{ | ||
parent::initialize(); | ||
$this->validate = new ClientCreditValidate(); | ||
} | ||
|
||
/** | ||
* 时间 2022-05-11 | ||
* @title 用户余额变更记录列表 | ||
* @desc 用户余额变更记录列表 | ||
* @author theworld | ||
* @version v1 | ||
* @url /admin/v1/client/:id/credit | ||
* @method GET | ||
* @param int start_time - 开始时间,时间戳(s) | ||
* @param int end_time - 结束时间,时间戳(s) | ||
* @param string type - 类型:人工Artificial,充值Recharge,应用至订单Applied,超付Overpayment,少付Underpayment,退款Refund | ||
* @param int id - 用户ID required | ||
* @param int order_id - 订单ID | ||
* @param int page - 页数 | ||
* @param int limit - 每页条数 | ||
* @return array list - 记录 | ||
* @return int list[].id - 记录ID | ||
* @return string list[].type - 类型:人工Artificial,充值Recharge,应用至订单Applied,超付Overpayment,少付Underpayment,退款Refund,提现Withdraw | ||
* @return string list[].amount - 金额 | ||
* @return string list[].notes - 备注 | ||
* @return int list[].create_time - 变更时间 | ||
* @return int list[].admin_id - 管理员ID | ||
* @return string list[].admin_name - 管理员名称 | ||
* @return int count - 记录总数 | ||
*/ | ||
public function clientCreditList() | ||
{ | ||
// 合并分页参数 | ||
$param = array_merge($this->request->param(), ['page' => $this->request->page, 'limit' => $this->request->limit, 'sort' => $this->request->sort]); | ||
|
||
// 实例化模型类 | ||
$ClientCreditModel = new ClientCreditModel(); | ||
|
||
// 获取记录 | ||
$data = $ClientCreditModel->clientCreditList($param); | ||
|
||
$result = [ | ||
'status' => 200, | ||
'msg' => lang('success_message'), | ||
'data' => $data | ||
]; | ||
return json($result); | ||
} | ||
|
||
/** | ||
* 时间 2022-05-11 | ||
* @title 更改用户余额 | ||
* @desc 更改用户余额 | ||
* @author theworld | ||
* @version v1 | ||
* @url /admin/v1/client/:id/credit | ||
* @method PUT | ||
* @param int id - 用户ID required | ||
* @param string type - 类型recharge充值deduction扣费 required | ||
* @param float amount - 金额 required | ||
* @param string notes - 备注 | ||
*/ | ||
public function update() | ||
{ | ||
// 接收参数 | ||
$param = $this->request->param(); | ||
|
||
// 参数验证 | ||
if (!$this->validate->scene('update')->check($param)){ | ||
return json(['status' => 400 , 'msg' => lang($this->validate->getError())]); | ||
} | ||
|
||
// 实例化模型类 | ||
$ClientCreditModel = new ClientCreditModel(); | ||
|
||
// 计算当前余额,小于0则报错 | ||
if($param['type']=='deduction' && $param['amount']>0){ | ||
$param['amount'] = -$param['amount']; | ||
} | ||
$param['type'] = 'Artificial'; | ||
|
||
// 修改余额 | ||
$result = $ClientCreditModel->updateClientCredit($param); | ||
|
||
return json($result); | ||
} | ||
|
||
/** | ||
* 时间 2022-05-24 | ||
* @title 充值 | ||
* @desc 充值 | ||
* @author wyh | ||
* @version v1 | ||
* @url /admin/v1/client/:id/recharge | ||
* @method post | ||
* @param int client_id 1 用户ID | ||
* @param float amount 1.00 金额 | ||
* @param string gateway WxPay 支付方式 | ||
*/ | ||
public function recharge() | ||
{ | ||
$param = $this->request->param(); | ||
|
||
$OrderTmpModel = new OrderTmpModel(); | ||
|
||
$OrderTmpModel->isAdmin = true; | ||
|
||
$result = $OrderTmpModel->recharge($param); | ||
|
||
return json($result); | ||
} | ||
} |
Oops, something went wrong.