|
|
@@ -38,6 +38,31 @@ class ItemController extends BaseController
|
|
|
util::success(['customList' => $customList]);
|
|
|
}
|
|
|
|
|
|
+ //清空单个客户的已购 ssh 20250710
|
|
|
+ public function actionClearOneLimitBuy()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $productId = $get['productId'] ?? '';
|
|
|
+ $customId = $get['customId'] ?? 0;
|
|
|
+ $item = ItemClass::getById($productId, true);
|
|
|
+ if (empty($item)) {
|
|
|
+ util::fail('没有找到花材');
|
|
|
+ }
|
|
|
+ if ($item->mainId != $this->mainId) {
|
|
|
+ util::fail('不是你的花材');
|
|
|
+ }
|
|
|
+ $custom = CustomClass::getById($customId, true);
|
|
|
+ if (empty($custom)) {
|
|
|
+ util::fail('没有客户');
|
|
|
+ }
|
|
|
+ if ($custom->ownMainId != $this->mainId) {
|
|
|
+ util::fail('不是你的客户');
|
|
|
+ }
|
|
|
+ ProductClass::cancelOneLimitBuy($productId, $customId);
|
|
|
+ util::complete('清除成功');
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//取消花材的限购,重新开始计算
|
|
|
public function actionClearLimitBuy()
|
|
|
{
|