wesmiler 6 years ago
parent
commit
438605276f
1 changed files with 4 additions and 4 deletions
  1. 4 4
      vendor/thinkcmf/cmf-app/src/admin/controller/ShopController.php

+ 4 - 4
vendor/thinkcmf/cmf-app/src/admin/controller/ShopController.php

@@ -1037,14 +1037,14 @@ class ShopController extends AdminBaseController
             $this->error('请先选择操作项!');
             $this->error('请先选择操作项!');
         }
         }
 
 
-        $id = is_array($id) ? implode(',', $id) : $id;
-        $info = Db::name('shop')->where(['id' => ['in'=> $id]])->field('id,user_id')->find();
+        $userIds = is_array($id) ? implode(',', $id) : $id;
+        $info = Db::name('shop')->where(['user_id' => ['in'=> $userIds]])->field('id,user_id')->find();
         if(empty($info)){
         if(empty($info)){
             $this->error('操作数据不存在!');
             $this->error('操作数据不存在!');
         }
         }
-        $userIds = Db::name('shop')->where(['id' => ['in'=> $id]])->column('user_id');
+//        $userIds = Db::name('shop')->where(['user_id' => ['in'=> $id]])->column('user_id');
         Db::startTrans();
         Db::startTrans();
-        if (Db::name('shop')->where(['id' => ['in'=>$id]])->delete()) {
+        if (Db::name('shop')->where(['user_id' => ['in'=>$userIds]])->delete()) {
             if($userIds){
             if($userIds){
                 $res = Db::name('user')->where('id','in',$userIds)
                 $res = Db::name('user')->where('id','in',$userIds)
                     ->update(['user_type'=> 2,'updated_at'=> date('Y-m-d H:i:s')]);
                     ->update(['user_type'=> 2,'updated_at'=> date('Y-m-d H:i:s')]);