|
|
@@ -76,14 +76,11 @@ class Pub extends BaseController
|
|
|
* @param Request $request
|
|
|
* @return type
|
|
|
*/
|
|
|
- public function getShowTemplateItem(Request $request){
|
|
|
- $post = UtilService::getMore([
|
|
|
- ['id', '','empty','参数错误'],
|
|
|
- ], $request);
|
|
|
+ public function getShowTemplateItem($id){
|
|
|
$data = (new ShowTemplate)
|
|
|
- ->field("id,title,price,old_price,status,imgs,is_hot,is_recommend,code,look_count,real_sales,unreal_sales")
|
|
|
- ->where("id",$post["id"])
|
|
|
- ->find();
|
|
|
+ ->field("id,title,price,old_price,status,imgs,is_hot,is_recommend,code,look_count,real_sales,unreal_sales")
|
|
|
+ ->where("id",$id)
|
|
|
+ ->find();
|
|
|
if(empty($data)){
|
|
|
return app('json')->fail("模板不存在");
|
|
|
}
|
|
|
@@ -98,7 +95,7 @@ class Pub extends BaseController
|
|
|
unset($data["real_sales"]);
|
|
|
unset($data["unreal_sales"]);
|
|
|
//验证是否购买过并添加浏览记录
|
|
|
- $this->checkUser($request->header("token", ""));
|
|
|
+ $this->checkUser(request()->header("token", ""));
|
|
|
if(!empty($this->user)){
|
|
|
$data["is_use"]=(new UserShowTemplate)->where("uid",$this->user["uid"])->where("show_template_id",$data["id"])->count()>0?1:0;
|
|
|
(new ShowTemplate)->where('id', $data["id"])->inc('look_count', 1)->update();
|