|
|
@@ -135,7 +135,7 @@ class ShopController extends BaseController {
|
|
|
$freight = floatval(Cache::getSystemConfig()['freight']['VALUE'] ?? 0);
|
|
|
// 普通商品免运费阈值.奈拉
|
|
|
$freeShipping = floatval(Cache::getSystemConfig()['freeShipping']['VALUE'] ?? 0);
|
|
|
-
|
|
|
+ $isDec = User::getEnCodeInfo(\Yii::$app->user->id)['IS_DEC'];
|
|
|
return static::notice(
|
|
|
[
|
|
|
'payList'=>$payList,
|
|
|
@@ -144,6 +144,7 @@ class ShopController extends BaseController {
|
|
|
'sellType' => ShopGoods::getCategoryType(),
|
|
|
'freight' => $freight,
|
|
|
'freeShipping' => $freeShipping,
|
|
|
+ 'isDec' => $isDec,
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -157,6 +158,18 @@ class ShopController extends BaseController {
|
|
|
$formModel->remark = 'FX';//复销备注
|
|
|
$post = \Yii::$app->request->post();
|
|
|
$post['type'] = DeclarationForm::TYPE_FX;
|
|
|
+ $userInfo = User::getEnCodeInfo(\Yii::$app->user->id);
|
|
|
+ if($userInfo['IS_DEC'] == 1 && !empty($post['userName']) && $post['userName'] != $userInfo['USER_NAME']){
|
|
|
+ return static::notice(Yii::t('app', 'stockistDoesNotExist'), 400);
|
|
|
+ }
|
|
|
+ if($post['userName']){
|
|
|
+ //查询报单编号是否存在
|
|
|
+ $userId = Info::getUserIdByUserName($post['userName']);
|
|
|
+ if(!$userId){
|
|
|
+ return static::notice(Yii::t('app', 'stockistDoesNotExist'), 400);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$formModel->decUserName = $post['userName'];
|
|
|
if ($formModel->load($post, '') && $order = $formModel->add()) {
|
|
|
return static::notice($order);
|
|
|
@@ -189,6 +202,17 @@ class ShopController extends BaseController {
|
|
|
$formModel->remark = '复销备注';
|
|
|
$post = \Yii::$app->request->post();
|
|
|
$post['type'] = DeclarationForm::TYPE_FX;
|
|
|
+ $userInfo = User::getEnCodeInfo(\Yii::$app->user->id);
|
|
|
+ if($userInfo['IS_DEC'] == 1 && !empty($post['userName']) && $post['userName'] != $userInfo['USER_NAME']){
|
|
|
+ return static::notice(Yii::t('app', 'stockistDoesNotExist'), 400);
|
|
|
+ }
|
|
|
+ //查询报单编号是否存在
|
|
|
+ if($post['userName']){
|
|
|
+ $userId = Info::getUserIdByUserName($post['userName']);
|
|
|
+ if(!$userId){
|
|
|
+ return static::notice(Yii::t('app', 'stockistDoesNotExist'), 400);
|
|
|
+ }
|
|
|
+ }
|
|
|
$formModel->decUserName = $post['userName'];
|
|
|
if ($formModel->load($post, '') && $order = $formModel->add()) {
|
|
|
return static::notice($order);
|