Browse Source

删除员工时,查询条件添加shopId的限制,从而实现只删除对应门店的

shizhongqi 6 tháng trước cách đây
mục cha
commit
0b4f3723d6
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      biz-hd/staff/classes/StaffClass.php

+ 3 - 3
biz-hd/staff/classes/StaffClass.php

@@ -194,15 +194,15 @@ class StaffClass extends BaseClass
             }
             $hasShop = 1;
         }
-        
+
         //把 xhHdDevice 与 xhGhsDevice 表下的数据更新为退出(删除)
-        $ghsDevices = \bizGhs\device\classes\GhsDeviceClass::getAllByCondition(['adminId' => $admin->id], null, 'id,status,clientId', null, true);
+        $ghsDevices = \bizGhs\device\classes\GhsDeviceClass::getAllByCondition(['adminId'=>$admin->id, 'shopId'=>$staff->shopId], null, 'id,status,clientId', null, true);
         foreach ($ghsDevices as $ghsDevice) {
             $ghsDevice->status = 0;
             $ghsDevice->clientId = $ghsDevice->clientId . '_delete_' . date('Y-m-d H:i:s');
             $ghsDevice->save();
         }
-        $hdDevices = \bizHd\device\classes\HdDeviceClass::getAllByCondition(['adminId' => $admin->id], null, 'id,status,clientId',null, true);
+        $hdDevices = \bizHd\device\classes\HdDeviceClass::getAllByCondition(['adminId'=>$admin->id, 'shopId'=>$staff->shopId], null, 'id,status,clientId',null, true);
         foreach ($hdDevices as $hdDevice) {
             $hdDevice->status = 0;
             $hdDevice->clientId = $hdDevice->clientId . '_delete_' . date('Y-m-d H:i:s');