| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace app\seller\controller;
- use app\common\validate\IDMustBePositiveInt;
- use app\common\controller\SellerController;
- use app\http\IResponse;
- use think\Controller;
- class Order extends SellerController
- {
- /**
- *
- * @author 许祖兴 < zuxing.xu@lettered.cn>
- * @date 2020/7/16 17:59
- *
- * @return mixed
- * @throws \Lettered\Support\Exceptions\FailedException
- * @throws \think\exception\DbException
- */
- public function index()
- {
- $where = [];
- //组合搜索
- !empty(input('name')) && $where[]
- = ['name', 'like', '%' . input('name') . '%'];
-
- $order = model('common/GoodsOrder');
- // TODO 商家要依据自己的ID查询
- return IResponse::paginate($order->where($where)
- ->where(['seller_id' => $this->seller->id])
- ->with(['user','addr'])
- ->paginate(input('limit'),false));
- }
-
- public function getOrderDetailById($id){
-
- (new IDMustBePositiveInt())->valid();
-
- //
- $order = model('common/GoodsOrderDetail');
- // TODO 商家要依据自己的ID查询
- return IResponse::paginate($order ->where(['order_id' => $id])
- ->order(['created_at' => 'desc'])
- ->paginate(input('limit'),false));
- }
-
- /**
- *
- * @author 许祖兴 < zuxing.xu@lettered.cn>
- * @date 2020/9/20 17:09
- *
- * @return mixed
- * @throws \Lettered\Support\Exceptions\FailedException
- * @throws \think\exception\DbException
- */
- public function getOrderService(){
- $service = model('common/GoodsOrderService');
- // TODO 商家要依据自己的ID查询
- return IResponse::paginate($service->where(['seller_id' => $this->seller->id])
- ->order(['created_at' => 'desc'])
- ->paginate(input('limit'),false));
- }
- }
|