|
|
@@ -23,15 +23,20 @@ class RechargeController extends BaseController
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
$hdId = $get['hdId'] ?? 0;
|
|
|
- $custom = CustomClass::getById($customId, true);
|
|
|
- if (empty($custom)) {
|
|
|
- util::fail('没有找到客户');
|
|
|
+ $status = $get['status'] ?? -1;
|
|
|
+ $hd = \bizMall\hd\classes\HdClass::getById($hdId, true);
|
|
|
+ $where = ['mainId' => $this->mainId];
|
|
|
+ if (!empty($hd)) {
|
|
|
+ if ($hd->shopId != $this->shopId) {
|
|
|
+ util::fail('不是你的门店');
|
|
|
+ }
|
|
|
+ $customId = $hd->customId ?? 0;
|
|
|
+ $where['customId'] = $customId;
|
|
|
}
|
|
|
- if ($custom->shopId != $this->shopId) {
|
|
|
- util::fail('不是你的客户');
|
|
|
+ if ($status > -1) {
|
|
|
+ $where['status'] = $status;
|
|
|
}
|
|
|
- $where = ['shopId' => $this->shopId, 'customId' => $customId];
|
|
|
- $list = RechargeClass::getRechargeList($where);
|
|
|
+ $list = \bizMall\recharge\classes\RechargeClass::getRechargeList($where);
|
|
|
util::success($list);
|
|
|
}
|
|
|
|
|
|
@@ -180,7 +185,7 @@ class RechargeController extends BaseController
|
|
|
$userId = $this->userId;
|
|
|
$shopId = $this->shopId;
|
|
|
if ($recharge->userId != $userId || $recharge->shopId != $shopId) {
|
|
|
- util::fail('不是你的充值单');
|
|
|
+ util::fail('不是你的单');
|
|
|
}
|
|
|
util::success($recharge);
|
|
|
}
|
|
|
@@ -204,6 +209,7 @@ class RechargeController extends BaseController
|
|
|
}
|
|
|
|
|
|
$mainId = $this->mainId;
|
|
|
+ $userId = $this->userId;
|
|
|
$hdId = $post['hdId'] ?? 0;
|
|
|
$salt = $post['salt'] ?? '';
|
|
|
$hd = HdClass::getById($hdId, true);
|
|
|
@@ -245,6 +251,7 @@ class RechargeController extends BaseController
|
|
|
'status' => 0,
|
|
|
'customId' => $customId,
|
|
|
'customName' => $customName,
|
|
|
+ 'userId' => $userId,
|
|
|
];
|
|
|
$respond = RechargeClass::addRecharge($rechargeData);
|
|
|
$rechargeId = $respond->id;
|