更新商品上下架store_spu表没有更新
This commit is contained in:
parent
2b02111bc7
commit
441b56c6a4
@ -1502,6 +1502,7 @@ class ProductRepository extends BaseRepository
|
|||||||
Queue(ChangeSpuStatusJob::class, ['id' => $product['product_id'], 'product_type' => $product['product_type']]);
|
Queue(ChangeSpuStatusJob::class, ['id' => $product['product_id'], 'product_type' => $product['product_type']]);
|
||||||
}
|
}
|
||||||
$ids = is_array($ids) ? $ids : explode(',', $ids);
|
$ids = is_array($ids) ? $ids : explode(',', $ids);
|
||||||
|
Db::name('store_spu')->where('product_id','in',$ids)->update(['status'=>$status]);
|
||||||
$this->dao->updates($ids,[$is => $status]);
|
$this->dao->updates($ids,[$is => $status]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ use think\App;
|
|||||||
use crmeb\basic\BaseController;
|
use crmeb\basic\BaseController;
|
||||||
use app\validate\merchant\StoreProductAdminValidate as validate;
|
use app\validate\merchant\StoreProductAdminValidate as validate;
|
||||||
use app\common\repositories\store\product\ProductRepository as repository;
|
use app\common\repositories\store\product\ProductRepository as repository;
|
||||||
|
use think\facade\Db;
|
||||||
use think\facade\Queue;
|
use think\facade\Queue;
|
||||||
|
|
||||||
class StoreProduct extends BaseController
|
class StoreProduct extends BaseController
|
||||||
@ -161,6 +162,7 @@ class StoreProduct extends BaseController
|
|||||||
$status = $this->request->param('status',0) == 1 ? 1 : 0;
|
$status = $this->request->param('status',0) == 1 ? 1 : 0;
|
||||||
$status = ['is_used' => $status];
|
$status = ['is_used' => $status];
|
||||||
$this->repository->update($id,$status);
|
$this->repository->update($id,$status);
|
||||||
|
Db::name('store_spu')->where('product_id',$id)->update(['status'=>$status['is_used']]);
|
||||||
queue(ChangeSpuStatusJob::class,['id' => $id,'product_type' => 0]);
|
queue(ChangeSpuStatusJob::class,['id' => $id,'product_type' => 0]);
|
||||||
return app('json')->success('修改成功');
|
return app('json')->success('修改成功');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user