1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- /**
- *
- *
- * @category xxx
- * @package PSR
- * @subpackage Documentation\API
- * @author xxx <xxx@xxx.com>
- * @license GPL https://xxx.com
- * @link https://xxx.com
- * @ctime: 2020/3/23 9:24
- */
- namespace App\Transformers;
- use App\Models\WalletLog;
- use League\Fractal\TransformerAbstract;
- class WalletLogTransformer extends TransformerAbstract
- {
- public function transform(WalletLog $walletLog)
- {
- return [
- 'id' => $walletLog->id,
- 'name' => $walletLog->name,
- 'operate_type' => WalletLog::$operateTypeMaps[$walletLog->operate_type],
- 'money' => $walletLog->money,
- 'created_at' => $walletLog->created_at->format('Y-m-d H:i:s'),
- ];
- }
- }
|