调整商品规格
This commit is contained in:
@@ -182,6 +182,12 @@ class GoodsController extends AdminController
|
||||
->default(0)
|
||||
->setWidth(2)
|
||||
->required();
|
||||
$form->radio('unit', '单位')
|
||||
->options([
|
||||
'瓶' => '瓶',
|
||||
'箱' => '箱',
|
||||
])
|
||||
->required();
|
||||
});
|
||||
})
|
||||
->when(Goods::TYPE_MULTIPLE, function ($form) {
|
||||
|
||||
@@ -77,6 +77,10 @@ class OrderBuyController extends Controller
|
||||
|
||||
|
||||
$type = OrderModel::TYPE_NORMAL;
|
||||
info($goods_sku->goods->channel);
|
||||
info($goods_sku->goods->id);
|
||||
info($goods_sku->id);
|
||||
|
||||
if ($goods_sku->goods->channel == Goods::CHANNEL_FREE) {
|
||||
$type = OrderModel::TYPE_SAMPLE;
|
||||
}
|
||||
@@ -85,13 +89,20 @@ class OrderBuyController extends Controller
|
||||
$type = OrderModel::TYPE_SCORE;
|
||||
}
|
||||
|
||||
$areaCode = $user->info->areaCode;
|
||||
if (! $areaCode && $type == OrderModel::TYPE_SAMPLE) {
|
||||
if ($type == OrderModel::TYPE_SAMPLE) {
|
||||
if (! $user->info->areaCode) {
|
||||
return $this->failed('您没有提货码不可参与此活动');
|
||||
}
|
||||
if ($areaCode->status != AreaCode::STATUS_INIT && $type == OrderModel::TYPE_SAMPLE) {
|
||||
$areaCode = AreaCode::where('code', $user->info->areaCode)->first();
|
||||
if (! $areaCode) {
|
||||
return $this->failed('您绑定的提货码不正确');
|
||||
}
|
||||
|
||||
if ($areaCode->status != AreaCode::STATUS_INIT) {
|
||||
return $this->failed('提货码已被使用,不可重复使用');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$freight = $item->freight();
|
||||
$amount = $item->total();
|
||||
@@ -179,13 +190,19 @@ class OrderBuyController extends Controller
|
||||
$type = OrderModel::TYPE_SCORE;
|
||||
}
|
||||
|
||||
$areaCode = $user->info->areaCode;
|
||||
if (! $areaCode && $type == OrderModel::TYPE_SAMPLE) {
|
||||
if ($type == OrderModel::TYPE_SAMPLE) {
|
||||
if (! $user->info->areaCode) {
|
||||
return $this->failed('您没有提货码不可参与此活动');
|
||||
}
|
||||
if ($areaCode->status != AreaCode::STATUS_INIT && $type == OrderModel::TYPE_SAMPLE) {
|
||||
$areaCode = AreaCode::where('code', $user->info->areaCode)->first();
|
||||
if (! $areaCode) {
|
||||
return $this->failed('您绑定的提货码不正确');
|
||||
}
|
||||
|
||||
if ($areaCode->status != AreaCode::STATUS_INIT) {
|
||||
return $this->failed('提货码已被使用,不可重复使用');
|
||||
}
|
||||
}
|
||||
|
||||
$address = Address::where('user_id', $user->id)->where('id', $address_id)->first();
|
||||
|
||||
|
||||
@@ -471,7 +471,7 @@ class WeChatController extends Controller
|
||||
|
||||
if ($delivery_code) {
|
||||
$areaCode = AreaCode::query()->where('code', $delivery_code)->first();
|
||||
if ($areaCode->user_id) {
|
||||
if ($areaCode->user_id && $areaCode->user_id != Api::userId()) {
|
||||
return $this->failed('当前提货码已被别人使用');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user