| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- /**
- * 管理员分页返回封装.
- *
- * @author nj
- * @date 2021-01-23 16:19:51
- */
- namespace Modules\ManageApi\Responses;
- use Illuminate\Contracts\Support\Arrayable;
- use Illuminate\Contracts\Support\Responsable;
- class NotIncrementIdDetailResponse implements Responsable
- {
- /**
- * 录入的数据.
- *
- * @var mixed
- */
- private $data = null;
- /**
- * 附加条件参数.
- *
- * @var array
- */
- private $params = [];
- public function __construct($data = null, $params = [])
- {
- $this->data = $data;
- $this->params = $params;
- }
- public function toResponse(
- $request = null
- ) {
- if ($this->data instanceof Arrayable) {
- $result = $this->data->toArray();
- } else {
- $result = $this->data;
- }
- unset($result['id']);
- return json_success($result);
- }
- }
|