all(); $pageSize = isset($params['pageSize'])? $params['pageSize'] : 18; $type = isset($params['type'])? $params['type'] : 1; $status = isset($params['status'])? $params['status'] : 0; // 我的订单 if($type == 1){ $params['user_id'] = $this->userId; $params['sell_uid'] = $this->userId; } // 推广订单 else if($type == 2){ $params['parent_id'] = $this->userId; } // 店铺订单 else if($type == 3){ $params['shop_id'] = $this->shopId; } $params['time'] = strtotime(date('Y-m-d'))-86400*7; $datas = TradeService::make()->getDataList($params, $pageSize); return message(1010, true, $datas); } /** * 详情 * @return array|mixed */ public function info() { $id = request()->post('id', 0); $info = TradeService::make()->getInfo($id); return message(1010, true, $info); } /** * 统计 * @return array */ public function counts() { $params = request()->all(); $type = isset($params['type'])? $params['type'] : 1; $status = isset($params['status'])? $params['status'] : 0; // 我的订单 if($type == 1){ if($status==2){ $params['sell_uid'] = $this->userId; }else{ $params['user_id'] = $this->userId; } } // 推广订单 else if($type == 2){ $params['parent_id'] = $this->userId; } // 店铺订单 else if($type == 3){ $params['shop_id'] = $this->shopId; } $params['time'] = strtotime(date('Y-m-d'))-86400*7; $counts = TradeService::make()->getCounts($params); return message(1010, true, $counts); } /** * 抢拍 * @return array */ public function buy() { if(TradeService::make()->buy(request()->all(), $this->userId, $this->shopId)){ return message(TradeService::make()->getError(), true); }else{ return message(TradeService::make()->getError(), false); } } /** * 付款 * @return array */ public function pay() { if(TradeService::make()->pay(request()->all(), $this->userId, $this->shopId)){ return message(TradeService::make()->getError(), true); }else{ return message(TradeService::make()->getError(), false); } } /** * 确认收款 * @return array */ public function confirm() { if(TradeService::make()->confirm(request()->all(), $this->userId)){ return message(TradeService::make()->getError(), true); }else{ return message(TradeService::make()->getError(), false); } } /** * 上架 * @return array */ public function sell() { if(TradeService::make()->sell(request()->all(), $this->userId)){ return message(TradeService::make()->getError(), true); }else{ return message(TradeService::make()->getError(), false); } } /** * 上架审核 * @return array */ public function sellConfirm() { if(TradeService::make()->sellConfirm(request()->all())){ return message(TradeService::make()->getError(), true); }else{ return message(TradeService::make()->getError(), false); } } /** * 修改订单 * @return array */ public function modify() { if(TradeService::make()->modify(request()->all())){ return message(TradeService::make()->getError(), true); }else{ return message(TradeService::make()->getError(), false); } } /** * 取消订单 * @return array */ public function cancel() { if(TradeService::make()->cancel(request()->all())){ return message(TradeService::make()->getError(), true); }else{ return message(TradeService::make()->getError(), false); } } }