| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- namespace app\controller\admin\system\pickUp;
- use app\common\repositories\store\order\PickUpRepository;
- class PickUp
- {
- protected $repository;
- /**
- * @param PickUpRepository $repository
- */
- public function __construct(PickUpRepository $repository)
- {
- $this->repository = $repository;
- }
- /**
- * @return mixed
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- * @author 史晨
- * @date 2026/3/20 10:13
- * 自提点地址列表
- */
- public function getList()
- {
- $params = request()->get();
- $list = $this->repository->adminList($params);
- return app('json')->success($list);
- }
- /**
- * @return mixed
- * @author 史晨
- * @date 2026/3/20 10:32
- * 添加自提点
- */
- public function add()
- {
- $params = request()->post();
- $res = $this->repository->add($params);
- if (!$res) {
- return app('json')->fail('添加失败');
- }
- return app('json')->success('添加成功');
- }
- /**
- * @param $id
- * @return mixed
- * @author 史晨
- * @date 2026/3/20 10:32
- * 获取自提点信息
- */
- public function get($id)
- {
- $data = $this->repository->get($id);
- if (!$data) {
- return app('json')->fail('获取失败');
- }
- return app('json')->success($data);
- }
- /**
- * @param $id
- * @return mixed
- * @author 史晨
- * @date 2026/3/20 10:33
- * 更新自提点信息
- */
- public function update($id)
- {
- $params = request()->post();
- $res = $this->repository->update($id, $params);
- if (!$res) {
- return app('json')->fail('添加失败');
- }
- return app('json')->success('添加成功');
- }
- }
|