repository = $repository; } /** * @param PartnerProfitsValidate $validate * @return mixed * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * 合伙人分红接口 */ public function partnerProfits(PartnerProfitsValidate $validate) { $validationResult = $this->validateRequest($validate, PartnerProfitsRequestEntity::class); // $res = $this->repository->getZeroUser($validationResult->toArray()); $res = $this->repository->profits($validationResult->toArray()); if (is_string($res)) { $response = ZeroUserProfitResponseEntity::error($res); return app('json')->fail($response->toResponseArray()); } $response = ZeroUserProfitResponseEntity::success(); return app('json')->success($response->toResponseArray()); } // 执行分红 public function executeProfit(ExecuteProfitValidate $validate) { $validationResult = $this->validateRequest($validate, ExecuteProfitRequestEntity::class); $this->repository->executeProfit($validationResult->toArray()); } }