dao = $dao; } public function updateSort(int $id,?int $merId,array $data) { $where[$this->dao->getPk()] = $id; if($merId) $where['mer_id'] = $merId; $ret = $this->dao->getWhere($where); if(!$ret) throw new ValidateException('数据不存在'); app()->make(ProductRepository::class)->update($ret['product_id'],$data); $make = app()->make(SpuRepository::class); return $make->updateSort($ret['product_id'],$ret[$this->dao->getPk()],1,$data); } }