|
|
@@ -1477,4 +1477,63 @@ class User extends BaseController
|
|
|
]);
|
|
|
return app('json')->success("解约成功");
|
|
|
}
|
|
|
+// 打卡列表
|
|
|
+ /**
|
|
|
+ * 打卡列表
|
|
|
+ * @param \app\Request $request
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function getClockList(\think\Request $request)
|
|
|
+ {
|
|
|
+ $post = UtilService::getMore([
|
|
|
+ ['page', 1],
|
|
|
+ ['pageSize', 50],
|
|
|
+ ['time','']
|
|
|
+ ], $request);
|
|
|
+ $post["pageSize"] = $post["pageSize"]>50 ? 50 : (int)$post["pageSize"];
|
|
|
+ $post["page"] = $post["page"]<=0 ? 1 : (int)$post["page"];
|
|
|
+ $where=[];
|
|
|
+ $uid = UtilService::getMore([
|
|
|
+ ['uid', 0],
|
|
|
+ ], $request);
|
|
|
+ $uid=$uid['uid'];
|
|
|
+// if ($uid>0){
|
|
|
+// $where[]=["uid","=",$uid];
|
|
|
+// }
|
|
|
+ $totalCount = (new UserClockModel())->where($where)->count();
|
|
|
+
|
|
|
+ if ($post["status"]!=-2){
|
|
|
+ $where[]=['status','=',$post["status"]];
|
|
|
+ }
|
|
|
+ $data=null;
|
|
|
+ if($totalCount>0){
|
|
|
+ $data = (new UserClockModel)
|
|
|
+ ->where($where)
|
|
|
+ ->order("id", "desc")
|
|
|
+ ->page($post["page"], $post["pageSize"])
|
|
|
+ ->select();
|
|
|
+// var_dump((new UserContractRecordModel)->getLastSql());die();
|
|
|
+// foreach($data as $k=>$v){
|
|
|
+// $data[$k]["is_use"] = 1;//是否已经购买或者可以使用
|
|
|
+// switch ($data[$k]["status"]){
|
|
|
+// case 0:
|
|
|
+// $data[$k]["status_name"] = "未签约";
|
|
|
+// break;
|
|
|
+// case 1:
|
|
|
+// $data[$k]["status_name"] = "已签约";
|
|
|
+// break;
|
|
|
+// case -1:
|
|
|
+// $data[$k]["status_name"] = "已解约";
|
|
|
+// break;
|
|
|
+// }
|
|
|
+//// $data[$k]["comment"] = (new ContractCommentModel())->where('contract_id',$v["id"])->select();
|
|
|
+// $data[$k]["comment"] = (new ContractCommentModel())->where('contract_id',$v["id"])->find();
|
|
|
+// if (!empty($data[$k]["comment"])){
|
|
|
+// $data[$k]["comment"] = $data[$k]["comment"]->toArray();
|
|
|
+// }
|
|
|
+// }
|
|
|
+ }
|
|
|
+ $data = empty($data)?[]:$data;
|
|
|
+ return app('json')->success(["list" => $data, "pageSize" => $post["pageSize"],"page"=>$post["page"],"totalCount"=>$totalCount]);
|
|
|
+ }
|
|
|
}
|