|
|
@@ -4,25 +4,35 @@ namespace hd\controllers;
|
|
|
|
|
|
use bizHd\ghs\classes\GhsBalanceChangeClass;
|
|
|
use bizHd\ghs\classes\GhsClass;
|
|
|
-use common\components\dict;
|
|
|
use common\components\util;
|
|
|
use Yii;
|
|
|
|
|
|
+/**
|
|
|
+ * 花店端供货商余额变动
|
|
|
+ * 小程序登录态与 H5 扫码付款(salt)共用 list 接口
|
|
|
+ */
|
|
|
class GhsBalanceChangeController extends BaseController
|
|
|
{
|
|
|
-
|
|
|
+ /** H5 付款页未登录也可查明细,依赖 salt 校验归属 */
|
|
|
public $guestAccess = ['list'];
|
|
|
|
|
|
- //余额变动明细
|
|
|
+ /**
|
|
|
+ * 余额变动明细列表
|
|
|
+ * 无 salt:校验当前店铺是否拥有该供货商;有 salt:与 get-ghs-data 一致按 salt 放行(H5 访客)
|
|
|
+ */
|
|
|
public function actionList()
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
$ghsId = $get['ghsId'] ?? 0;
|
|
|
$salt = $get['salt'] ?? '';
|
|
|
$ghs = GhsClass::getById($ghsId, true);
|
|
|
+ if (empty($ghs)) {
|
|
|
+ util::fail('无法查看');
|
|
|
+ }
|
|
|
if (empty($salt)) {
|
|
|
GhsClass::valid($ghs, $this->shopId);
|
|
|
} else {
|
|
|
+ // 扫码付款链接携带 salt,与小程序余额明细共用同一套数据
|
|
|
if ($ghs->salt != $salt) {
|
|
|
util::fail('无法查看');
|
|
|
}
|
|
|
@@ -32,5 +42,4 @@ class GhsBalanceChangeController extends BaseController
|
|
|
$list = GhsBalanceChangeClass::getChangeList($where);
|
|
|
util::success($list);
|
|
|
}
|
|
|
-
|
|
|
}
|