site['sassid']; $siteProduct = new SiteProduct; $siteProduct->setSassId($sassid); list($pageCount,$data) = $siteProduct->getList($post['page'],$post,$pageSize); $totalCount['count'] = $siteProduct->where('sassid',$sassid)->count(); $totalCount['downCount'] = $siteProduct->where('sassid',$sassid)->where('status',0)->count(); $totalCount['upCount'] = $siteProduct->where('sassid',$sassid)->where('status',1)->count(); return app('json')->success([ 'list' => $data, 'pageCount' => $pageCount, 'pageSize' => $pageSize, 'page' => $post['page'], 'totalCount'=>$totalCount ]); } /** * 保存数据 * @param Request $request */ public function save(Request $request) { $post = UtilService::getMore([ ['id',0], ['is_host',0], ['is_new',0], ['status',''], ['ver_bug_count',0], ['price',0] ],$request); $post["status"]=$post["status"]==1?1:0; $sassid = $request->site['sassid']; $siteProduct = new SiteProduct; $siteProduct->setSassId($sassid); $bool = $siteProduct->saveProduct($post); if(!$bool) { return app('json')->fail(SiteProduct::getErrorInfo()); } return app('json')->success("数据保存成功"); } /** * 获取产品基本信息 * @param Request $request */ public function info(Request $request) { [$id] = UtilService::getMore([ ['id','','empty','参数错误'] ],$request,true); $sassid = $request->site['sassid']; $siteProduct = new SiteProduct; $siteProduct->setSassId($sassid); $info = $siteProduct->getProInfo(compact('id')); return app('json')->success($info); } }