id); if (empty($Scratch)) { throw new \ErrorException('ccc'); } $data = [ 'id' => $userData->id ?? '',//会员id 'nickname' => $userData->nickname ?? '',//会员昵称 'mobile' => $userData->mobile ?? '',//手机号 'avatar_url' => $userData->avatar_url ?? '',//头像 ]; return $data; } catch (\ErrorException $errorException) { throw new \ErrorException($errorException->getMessage()); } catch (\Exception $exception) { throw new \Exception($exception->getMessage()); } } /** * @param $mallId * @param $userData * @param string $fromType * @param string $capitalType * @param int $page * @param int $limit * @param string[] $order * @return mixed * @throws \ErrorException */ public static function getLogList($mallId, $userData, $fromType = [], $capitalType = '', $page = 1, $limit = 10, $order = 'id desc') { try { $params = [ 'page' => $page, 'limit' => $limit, 'order' => $order, 'select' => 'id,change_num,source_table,source_table_id,from_type,capital_type,log_type', 'where' => [ ['=', 'mall_id', $mallId], ['=', 'user_id', $userData->id], ['in', 'from_type', $fromType], ], ]; if (!empty($capitalType)) { $params['where'][] = ['=', 'capital_type', ScratchEnum::getApiCapitalType($capitalType)]; } $list = ScratchCommissionLog::listPage($params); return $list; } catch (\ErrorException $errorException) { throw new \ErrorException($errorException->getMessage()); } catch (\Exception $exception) { throw new \Exception($exception->getMessage()); } } }