|
|
@@ -24,8 +24,10 @@ class ShopAdminClass extends BaseClass
|
|
|
//判断当前登录的人,在自己有财务权限的main里面,是否包括了这个花材所属的平台id,在这个平台id下所有花材的main
|
|
|
$staffList = ShopAdminClass::getAllByCondition(['adminId' => $adminId], null, '*', null, true);
|
|
|
$hasMainList = [];
|
|
|
+ $mayList = [];
|
|
|
if (!empty($staffList)) {
|
|
|
foreach ($staffList as $staff) {
|
|
|
+ $mayList[] = $staff->mainId;
|
|
|
if ($staff->super == 1) {
|
|
|
$hasMainList[] = $staff->mainId;
|
|
|
}
|
|
|
@@ -35,8 +37,14 @@ class ShopAdminClass extends BaseClass
|
|
|
$sameMainList = array_column($sameList, 'mainId');
|
|
|
$hasNot = array_diff($sameMainList, $hasMainList);
|
|
|
$hasRightChange = empty($hasNot) ? 1 : 0;
|
|
|
- //是否允许修改花材单位比、单位和重量等
|
|
|
- return ['hasRightChange' => $hasRightChange];
|
|
|
+
|
|
|
+ $mayHasNot = array_diff($sameMainList, $mayList);
|
|
|
+ $reason = '不能修改原因:别的批发店也在用此花材';
|
|
|
+ if (empty($mayHasNot)) {
|
|
|
+ $reason = '不能修改原因:你在某个店没有改库存改价';
|
|
|
+ }
|
|
|
+
|
|
|
+ return ['hasRightChange' => $hasRightChange, 'reason' => $reason];
|
|
|
}
|
|
|
|
|
|
const GENERATE_ADMIN_DATA = 'generate_ghs_admin_data_';//创建管理员需要的数据
|