|
|
@@ -505,8 +505,8 @@ class User extends BaseController
|
|
|
$post["pageSize"] = $post["pageSize"]>50 ? 50 : (int)$post["pageSize"];
|
|
|
$post["page"] = $post["page"]<=0 ? 1 : (int)$post["page"];
|
|
|
$where=[];
|
|
|
-// $where[]=["status","=",1];
|
|
|
- $totalCount = (new UserShowTemplate)->where($where)->count();
|
|
|
+ $where[]=["ut.uid","=",$request->user["uid"]];
|
|
|
+ $totalCount = (new UserShowTemplate)->alias("ut")->where($where)->count();
|
|
|
$data=null;
|
|
|
if($totalCount>0){
|
|
|
$data = (new UserShowTemplate)
|
|
|
@@ -530,6 +530,18 @@ class User extends BaseController
|
|
|
$data = empty($data)?[]:$data;
|
|
|
return app('json')->success(["list" => $data, "pageSize" => $post["pageSize"],"page"=>$post["page"],"totalCount"=>$totalCount]);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 设置默认模板
|
|
|
+ * @param Request $request
|
|
|
+ */
|
|
|
+ public function setShowTemplate(Request $request){
|
|
|
+ [$show_template_id] = UtilService::getMore([
|
|
|
+ ['show_template_id','','empty','参数错误'],
|
|
|
+ ],$request,true);
|
|
|
+ (new UserShowTemplate)->where("uid",$request->user["uid"])->where("is_default",0)->update(["is_default",0]);
|
|
|
+ (new UserShowTemplate)->where("uid",$request->user["uid"])->where("show_template_id",$show_template_id)->update(["is_default",1]);
|
|
|
+ return app('json')->success("设置成功");
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|