123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace App\Dao\Report;
- use App\Models\Report\ReportLog;
- class ReportDao
- {
- /**
- * @param $data
- * @return false
- */
- public function saveReportLog($data): bool
- {
- if (empty($data)) {
- return false;
- }
- return ReportLog::insert($data);
- }
- /**
- * @param $clickId
- * @param $eventType
- * @return array
- */
- public function getReportLogByClickId($clickId, $eventType): array
- {
- if (empty($clickId)) {
- return [];
- }
- $result = ReportLog::select('id', 'clickid', 'projectid', 'promotionid', 'uid')
- ->where('clickid', $clickId)
- ->where('event_type', $eventType)
- ->first();
- return $result ? $result->toArray() : [];
- }
- }
|