1234567891011121314151617181920212223242526272829 |
- <?php
- namespace App\Transformers;
- use App\Models\NoticeRule;
- use Illuminate\Support\Carbon;
- use League\Fractal\TransformerAbstract;
- class NoticeRuleListTransformer extends TransformerAbstract
- {
- public function transform(NoticeRule $noticeRule)
- {
- // $messageStatus = $noticeRule['notice_status'];
- // if($messageStatus == 0 && $noticeRule['send_time'] && $noticeRule['send_time'] <= Carbon::now()->toDateTimeString()){
- // $messageStatus = 1;
- // }
- return [
- 'id' => $noticeRule['id'],
- // 'title' => $messageRule['title'],
- // 'message_type' => $messageRule['message_type'],
- // 'cover' => $messageRule['cover'],
- // 'updated_at' => Carbon::parse($messageRule['updated_at'])->toDateTimeString(),
- // 'sent_count' => $messageRule['sent_count'],
- // 'open_count' => $messageRule['open_count'],
- // 'notice_groups' => $messageRule['notice_groups'],
- // 'message_status' => $messageStatus,
- ];
- }
- }
|