12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- /**
- *
- *
- * @category xxx
- * @package PSR
- * @subpackage Documentation\API
- * @author xxx <xxx@xxx.com>
- * @license GPL https://xxx.com
- * @link https://xxx.com
- * @ctime: 2020/5/19 9:42
- */
- namespace App\Transformers;
- use App\Models\PunishmentOrder;
- use Carbon\Carbon;
- use League\Fractal\TransformerAbstract;
- class PunishmentOrdersTransformer extends TransformerAbstract
- {
- public function transform(PunishmentOrder $model){
- return [
- 'no' => $model->no,
- // 'name' => $model->name,
- 'bike_no' => $model->bikes->bike_no,
- 'detail' => $model->detail,
- 'occurrence_time' => Carbon::parse($model->occurrence_time)->format('Y-m-d H:i:s'),
- 'pay_money' => $model->pay_money,
- 'pay_status' => $model->pay_status,
- 'pay_status_name' => PunishmentOrder::$payStatusMaps[$model->pay_status],
- ];
- }
- }
|