all(); $pageSize = isset($params['pageSize'])? $params['pageSize'] : 18; $shopInfo = ShopService::make()->getInfo($this->shopId); $shopUid = isset($shopInfo['user_id'])? $shopInfo['user_id'] : 0; // 非店长不可看到自己的商品 if($shopUid != $this->userId){ $params['not_user_id'] = $this->userId; } $params['shop_id'] = $this->shopId; $params['is_trade'] = 2; $params['status'] = 1; $params['type'] = 1; $params['split_stop'] = 2; $params['time'] = strtotime(date('Y-m-d')); $datas = GoodsService::make()->getDataList($params, $pageSize); return message(1010, true, $datas); } /** * @return array */ public function lists() { $params = request()->all(); $pageSize = isset($params['pageSize'])? $params['pageSize'] : 18; $params['shop_id'] = $this->shopId; $datas = GoodsService::make()->getDataList($params, $pageSize); return message(1010, true, $datas); } /** * 待售商品 * @return array */ public function wait() { $params = request()->all(); $pageSize = isset($params['pageSize'])? $params['pageSize'] : 18; $params['shop_id'] = $this->shopId; $params['type'] = 2; $datas = GoodsService::make()->getDataList($params, $pageSize); return message(1010, true, $datas); } /** * 上架审核 * @return array */ public function sell() { $params = request()->all(); $pageSize = isset($params['pageSize'])? $params['pageSize'] : 18; $params['shop_id'] = $this->shopId; $params['status'] = 4; $datas = GoodsService::make()->getTradeGoods($params, $pageSize); return message(1010, true, $datas); } /** * 积分商品 * @return array */ public function score() { $params = request()->all(); $pageSize = isset($params['pageSize'])? $params['pageSize'] : 18; $datas = ScoreGoodsService::make()->getDataList($params, $pageSize); return message(1010, true, $datas); } /** * 拆分 * @return array */ public function split() { $params = request()->all(); $goodsId = isset($params['id'])? $params['id'] : 0; if(GoodsService::make()->splitGoods($goodsId)){ return message(GoodsService::make()->getError(), true); }else{ return message(GoodsService::make()->getError(), false); } } /** * 转场 * @return array */ public function change() { $params = request()->all(); $goodsIds = isset($params['ids'])? $params['ids'] : 0; if(GoodsService::make()->change($goodsIds)){ return message(GoodsService::make()->getError(), true); }else{ return message(GoodsService::make()->getError(), false); } } /** * 转会员 * @return array */ public function switchUser() { $params = request()->all(); if(GoodsService::make()->switchUser($params)){ return message(GoodsService::make()->getError(), true); }else{ return message(GoodsService::make()->getError(), false); } } /** * 封存 * @return array */ public function lock() { $params = request()->all(); $goodsId = isset($params['id'])? $params['id'] : 0; if(GoodsService::make()->lock($goodsId)){ return message(GoodsService::make()->getError(), true); }else{ return message(GoodsService::make()->getError(), false); } } /** * 修改 * @return array */ public function modify() { $params = request()->all(); $goodsId = isset($params['id'])? $params['id'] : 0; if(GoodsService::make()->modify($goodsId)){ return message(GoodsService::make()->getError(), true); }else{ return message(GoodsService::make()->getError(), false); } } }