From c9296ecb2ae6905df00593530a8784f2997e182a Mon Sep 17 00:00:00 2001 From: tiansf Date: Thu, 3 Apr 2025 18:19:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=BB=88=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KitchenScale/controller/app/Base.php | 48 +- .../KitchenScale/controller/app/Cookbook.php | 535 +++-- .../KitchenScale/controller/app/Countfood.php | 474 ++++- .../KitchenScale/controller/app/Index.php | 366 ++-- .../controller/app/Usercenter.php | 334 ++- .../KitchenScale/controller/app/Wechat.php | 123 ++ application/admin/controller/Appversion.php | 2 +- application/admin/controller/Kitchenscale.php | 62 + application/admin/view/index/index.html | 36 + .../admin/view/kitchenscale/card_add.html | 218 ++ .../admin/view/kitchenscale/card_edit.html | 232 ++ .../food_ingredients_index_1.html | 251 +++ .../food_ingredients_index_2.html | 251 +++ .../food_ingredients_index_3.html | 251 +++ application/app/controller/Login.php | 97 +- application/app/controller/Msginformation.php | 34 +- application/app/controller/Myinformation.php | 2 +- application/app/controller/Wechat.php | 124 ++ application/code/controller/Qrcode.php | 352 ++++ .../code/view/qrcode/little_tips_project.html | 382 ++++ .../qrcode/little_tips_project_set_page.html | 608 ++++++ application/config.php | 26 +- application/route.php | 79 +- composer.json | 9 +- public/kitchenscale_all/privacy_index.html | 101 + vendor/composer/autoload_classmap.php | 5 + vendor/composer/autoload_files.php | 7 + vendor/composer/autoload_namespaces.php | 1 + vendor/composer/autoload_psr4.php | 21 + vendor/composer/autoload_static.php | 133 ++ vendor/composer/installed.json | 1871 ++++++++++++++++- vendor/composer/installed.php | 280 ++- vendor/myclabs/php-enum/README.md | 2 + vendor/myclabs/php-enum/composer.json | 4 +- vendor/myclabs/php-enum/src/Enum.php | 3 +- .../php-enum/src/PHPUnit/Comparator.php | 2 +- 36 files changed, 6903 insertions(+), 423 deletions(-) create mode 100644 application/KitchenScale/controller/app/Wechat.php create mode 100644 application/admin/controller/Kitchenscale.php create mode 100644 application/admin/view/kitchenscale/card_add.html create mode 100644 application/admin/view/kitchenscale/card_edit.html create mode 100644 application/admin/view/kitchenscale/food_ingredients_index_1.html create mode 100644 application/admin/view/kitchenscale/food_ingredients_index_2.html create mode 100644 application/admin/view/kitchenscale/food_ingredients_index_3.html create mode 100644 application/app/controller/Wechat.php create mode 100644 application/code/view/qrcode/little_tips_project.html create mode 100644 application/code/view/qrcode/little_tips_project_set_page.html create mode 100644 public/kitchenscale_all/privacy_index.html diff --git a/application/KitchenScale/controller/app/Base.php b/application/KitchenScale/controller/app/Base.php index 664871e..480f6cb 100644 --- a/application/KitchenScale/controller/app/Base.php +++ b/application/KitchenScale/controller/app/Base.php @@ -247,6 +247,45 @@ class Base extends Controller{ $return_result['result'] = $result; return $this->msg($return_result); } + public function pic_upload_one_action(){ + $temporary_data = []; + $cfc = Db::connect('cfc_db'); + $file = request()->file('image'); + $token = request()->param('token'); + if(!$token){ + return $this->msg(10001,'token is miss'); + } + if($file){ + $name = $file->getInfo()['name']; + // 使用 pathinfo() 函数获取文件名的扩展名 + $pathinfo = pathinfo($name); + $extension = strtolower($pathinfo['extension']); // 转换为小写以进行不区分大小写的比较 + $new_filename = time().$this->generateRandomString(). '.' . $extension; + $info = $file->validate(['size'=>$this->file_size,'ext'=>'jpg,png,gif'])->move(ROOT_PATH . 'public' . DS . 'kitchenscale_all' . DS . 'user_upload',$new_filename); + if($info){ + $temporary_data = [ + 'user_token'=>$token, + 'pic_name'=>$new_filename, + 'pic_url'=>"https://tc.pcxbc.com/kitchenscale_all/user_upload/".$new_filename, + 'create_time'=>date('Y-m-d H:i:s'), + ]; + $pic_id = $cfc->table('app_user_upload_img')->insertGetId($temporary_data); + if($pic_id){ + $temporary_data['id'] = $pic_id; + unset($temporary_data['create_time']); + unset($temporary_data['user_token']); + return $this->msg($temporary_data); + }else{ + return $this->msg(10002); + } + }else{ + // 上传失败获取错误信息 + return $this->msg(10010,$file->getError()); + } + }else{ + return $this->msg(10001,'未选择图片'); + } + } public function pic_upload_action(){ $insert_data = []; $temporary_data = []; @@ -257,10 +296,10 @@ class Base extends Controller{ if(!$token){ return $this->msg(10001,'token is miss'); } - if(count($files)>5){ - return $this->msg(10001,'单次最多上传5张图片'); - } if($files){ + if(count($files)>5){ + return $this->msg(10001,'单次最多上传5张图片'); + } foreach($files as $file){ $name = $file->getInfo()['name']; // 使用 pathinfo() 函数获取文件名的扩展名 @@ -302,7 +341,7 @@ class Base extends Controller{ return $this->msg(10001,'未选择图片'); } } - + ####################################################图片选择上传end############################################################## public function msg($data,$str='',$result = []){ if(is_array($data)){ @@ -328,6 +367,7 @@ class Base extends Controller{ } return $randomString; } + public function ceshi(){ echo 'hello'; diff --git a/application/KitchenScale/controller/app/Cookbook.php b/application/KitchenScale/controller/app/Cookbook.php index da2c657..d2737ce 100644 --- a/application/KitchenScale/controller/app/Cookbook.php +++ b/application/KitchenScale/controller/app/Cookbook.php @@ -9,6 +9,7 @@ class Cookbook extends Base{ // protected $token_time = 2592000;//30天的秒数 protected $default_head_pic = 'http://tc.pcxbc.com/tsf/head_pic.png'; + protected $page_num = 10; protected $reedaw_db_msg = [ 'zhanghao'=>'app_account_number',//账号表 'juese'=>'app_user_data',//角色表 @@ -23,7 +24,7 @@ class Cookbook extends Base{ 'foodlist2'=>'app_food_type_two',//食材列表3 'foodlist3'=>'app_food_type_three',//食材列表3 'user_kcal_log'=>'app_user_kcal_log',//食材列表3 - + 'user'=>'app_user_data',//banner ]; // 加 bcadd(,,20) @@ -97,8 +98,8 @@ class Cookbook extends Base{ // return json(['status' => 'error', 'message' => '系统错误']); // } } - // 根据菜谱标签查询列表(首页用)(OK) - public function find_by_cook_label($data=['token'=>'caadd1be045a65f3','cook_label'=>2,'page'=>'1']){ + // 修改菜谱(OK) + public function update_cookbook(){ // 尝试捕获异常 // try { if(count(input('post.')) > 0){ @@ -107,15 +108,81 @@ class Cookbook extends Base{ if(!array_key_exists('token', $data)){ return $this->msg(10001,'token is miss'); } + if(!array_key_exists('cover', $data)){ + return $this->msg(10001,'cover is miss'); + } + if(!array_key_exists('description', $data)){ + return $this->msg(10001,'description is miss'); + } + if(!array_key_exists('cook_label', $data)){ + return $this->msg(10001,'cook_label is miss'); + } + if(!array_key_exists('food_list', $data)){ + $data['food_list'] = []; + } + if(!array_key_exists('step_list', $data)){ + $data['step_list'] = []; + } + if(!array_key_exists('cookbook_id', $data)){ + return $this->msg(10001,'cookbook_id is miss'); + } + + if(!$this->verify_data_is_ok($data['token'],'str')){ + return $this->msg(10005,'token type is error'); + } + if(!$this->verify_data_is_ok($data['cover'],'intnum')){ + return $this->msg(10005,'cover type is error'); + } + if(!$this->verify_data_is_ok($data['description'],'str')){ + return $this->msg(10005,'description type is error'); + } + if(!$this->verify_data_is_ok($data['cook_label'],'intnum')){ + return $this->msg(10005,'cook_label type is error'); + } + if (!is_array($data['food_list'])) { + return $this->msg(10005,'food_list type is error'); + } + if (!is_array($data['step_list'])) { + return $this->msg(10005,'step_list type is error'); + } + if(!$this->verify_data_is_ok($data['cookbook_id'],'intnum')){ + return $this->msg(10005,'cookbook_id type is error'); + } + + + + $return_data = $this->update_cookbook_action($data); + return $return_data; + // } catch (\Exception $e) { + // // 捕获异常 + // $logContent["file"] = $e->getFile(); + // $logContent["line"] = $e->getLine(); + // $logContent['all_content'] = "异常信息:\n"; + // $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; + // $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; + // $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + // $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; + // $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; + // // 记录日志 + // // $this->record_api_log($data, $logContent, null); + // return json(['status' => 'error', 'message' => '系统错误']); + // } + } + // 根据菜谱标签查询列表(首页用)(OK) + public function find_by_cook_label($data=['token'=>'','cook_label'=>4,'page'=>'1']){ + // 尝试捕获异常 + // try { + if(count(input('post.')) > 0){ + $data = input('post.'); + } + if(!array_key_exists('cook_label', $data)){ return $this->msg(10001,'cook_label is miss'); } if(!array_key_exists('page', $data)){ return $this->msg(10001,'page is miss'); } - if(!$this->verify_data_is_ok($data['token'],'str')){ - return $this->msg(10005,'token type is error'); - } + if(!$this->verify_data_is_ok($data['cook_label'],'intnum')){ return $this->msg(10005,'cook_label type is error'); } @@ -182,21 +249,15 @@ class Cookbook extends Base{ // } } // 查询食谱的详情(OK) - public function cookbook_details($data=['token'=>'caadd1be045a65f30b92aa805f1de54a','cookbook_id'=>'21']){ + public function cookbook_details($data=['token'=>'','cookbook_id'=>'21']){ // 尝试捕获异常 // try { if(count(input('post.')) > 0){ $data = input('post.'); } - if(!array_key_exists('token', $data)){ - return $this->msg(10001,'token is miss'); - } if(!array_key_exists('cookbook_id', $data)){ return $this->msg(10001,'cookbook_id is miss'); } - if(!$this->verify_data_is_ok($data['token'],'str')){ - return $this->msg(10005,'token type is error'); - } if(!$this->verify_data_is_ok($data['cookbook_id'],'intnum')){ return $this->msg(10005,'cookbook_id type is error'); } @@ -358,17 +419,23 @@ class Cookbook extends Base{ // } } // 获取所有食材列表 - public function get_food_list($data=['token'=>'caadd1be045a65f30b92aa805f1de54a']){ + public function get_food_list($data=['food_level2_id'=>'4','search_data'=>'','page'=>1]){ // 尝试捕获异常 // try { if(count(input('post.')) > 0){ $data = input('post.'); } - if(!array_key_exists('token', $data)){ - return $this->msg(10001,'token is miss'); + if(!array_key_exists('food_level2_id', $data)){ + return $this->msg(10001,'food_level2_id is miss'); } - if(!$this->verify_data_is_ok($data['token'],'str')){ - return $this->msg(10005,'token type is error'); + if(!array_key_exists('page', $data)){ + return $this->msg(10001,'page is miss'); + } + if(!$this->verify_data_is_ok($data['food_level2_id'],'intnum')){ + return $this->msg(10005,'food_level2_id type is error'); + } + if(!$this->verify_data_is_ok($data['page'],'intnum')){ + return $this->msg(10005,'page type is error'); } $return_data = $this->get_food_list_action($data); @@ -476,7 +543,8 @@ class Cookbook extends Base{ $data['food_list'] =$kcal_data; // 处理食材卡路里end - + // dump($data['food_list']); + // die; $insert_data = [ 'title'=>$data['title'], 'cover'=>$data['cover'], @@ -500,12 +568,89 @@ class Cookbook extends Base{ return $this->msg(10002); } } - public function find_by_cook_label_action($data){ + public function update_cookbook_action($data){ // 获取账号下信息以及用户信息 $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic')->find(); if(!$user_data){ return $this->msg(20001,'账号信息错误'); } + + if(count($data['food_list']) < 1){ + return $this->msg(10001,'至少添加一个食物'); + } + if(count($data['step_list']) < 1){ + return $this->msg(10001,'至少添加一个步骤'); + } + $food_type = []; + // 检验一下food_list是否合规(食材列表) + foreach ($data['food_list'] as $key => $value) { + if (!array_key_exists('name', $value) || !array_key_exists('weight', $value)) { + return $this->msg(10001,'食材缺少名称或者重量'); + } + if(!$this->verify_data_is_ok($value['name'],'str')){ + return $this->msg(10005,'食材名称格式错误'); + } + if(!$this->verify_data_is_ok($value['weight'],'intnum')){ + return $this->msg(10005,'食材重量格式错误,需整数数字'); + } + if(!in_array($value['name'], $food_type)){ + array_push($food_type, $value['name']); + } + } + // 检验一下step_list是否合规(步骤列表) + foreach ($data['step_list'] as $key => $value) { + if (!array_key_exists('description', $value) || !array_key_exists('pic_list', $value)) { + return $this->msg(10001,'步骤缺少描述或者图片'); + } + if(!$this->verify_data_is_ok($value['description'],'str')){ + return $this->msg(10005,'步骤描述格式错误,需要正常字符'); + } + foreach ($value['pic_list'] as $k => $v) { + if(!$this->verify_data_is_ok($v,'intnum')){ + return $this->msg(10005,'步骤中图片ID错误,需整数数字'); + } + } + } + $cfc = Db::connect('cfc_db'); + // 获取账号下信息以及用户信息 + // $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic')->find(); + // if(!$user_data){ + + // } + + // 处理食材卡路里start + $kcal_data = $this->count_calorie($data['food_list'],$data['step_list']); + $data['food_list'] =$kcal_data; + // 处理食材卡路里end + + // dump($data['food_list']); + // die; + $insert_data = [ + 'title'=>$data['title'], + 'cover'=>$data['cover'], + 'create_user_token'=>$user_data['token'], + 'create_user_head_pic'=>$user_data['head_pic'], + 'create_user_nickname'=>$user_data['nickname'], + 'describe_data'=>$data['description'], + 'food_data'=>json_encode($data['food_list']), + 'step_data'=>json_encode($data['step_list']), + 'food_type'=>implode(',', $food_type), + 'cook_label'=>$data['cook_label'], + ]; + + $cook_book_result = $cfc->table($this->kitchenscale_db_msg['cookbook'])->where(['id'=>$data['cookbook_id']])->update($insert_data); + + // dump($cook_book_result); + // die; + if($cook_book_result){ + return $this->msg([]); + }else{ + return $this->msg(10002); + } + } + + public function find_by_cook_label_action($data){ + $page_now = $data['page']; $page_total = $data['page']; $page_num = 20; @@ -513,36 +658,64 @@ class Cookbook extends Base{ $cfc = Db::connect('cfc_db'); $content_num = $cfc->table($this->kitchenscale_db_msg['cookbook']) - ->where(['cook_label'=>$cook_label]) + ->where(['cook_label'=>$cook_label,'is_del'=>0]) ->count(); $page_total = ceil($content_num/$page_num); $content_list = $cfc->table($this->kitchenscale_db_msg['cookbook']) - ->alias('cookbook') - ->join($this->kitchenscale_db_msg['uploadimg'].' uploadimg','cookbook.cover = uploadimg.id','LEFT') - ->where(['cookbook.cook_label'=>$cook_label]) - ->field('cookbook.id,cookbook.title,uploadimg.pic_url as cover,cookbook.create_user_head_pic,cookbook.create_user_nickname,cookbook.likes_num') + ->alias('a') + ->join($this->kitchenscale_db_msg['uploadimg'].' b','a.cover = b.id','LEFT') + ->where(['a.cook_label'=>$cook_label,'a.is_del'=>0]) + ->field('a.id,a.title,b.pic_url as cover,a.create_user_head_pic,a.create_user_nickname,a.likes_num') + ->order('id DESC') ->page("$page_now,$page_num") ->select(); - - // 获取用户收藏列表 - $my_collect_list = $cfc->table($this->kitchenscale_db_msg['collect_list']) - ->where(['token'=>$data['token']]) - ->column('cookbook_id'); - // dump($my_collect_list); - // 处理菜谱收藏信息 - foreach ($content_list as $key => $value) { - // if(in_array($value['id'],$my_collect_list)){ - if(array_key_exists($value['id'],$my_collect_list)){ - $content_list[$key]['is_me_like_it'] = 'yes'; + + if(array_key_exists('token',$data)){ + if($data['token'] != ''){ + // 获取账号下信息以及用户信息 + $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic')->find(); + if(!$user_data){ + return $this->msg(20001,'账号信息错误'); + } + // 获取用户收藏列表 + $my_collect_list = $cfc->table($this->kitchenscale_db_msg['collect_list']) + ->where(['token'=>$data['token'],'is_del'=>0]) + ->column('cookbook_id'); + // dump($my_collect_list); + // 处理菜谱收藏信息 + foreach ($content_list as $key => $value) { + // if(in_array($value['id'],$my_collect_list)){ + if(array_key_exists($value['id'],$my_collect_list)){ + $content_list[$key]['is_me_like_it'] = 'yes'; + }else{ + $content_list[$key]['is_me_like_it'] = 'no'; + } + if($value['cover'] == null){ + $content_list[$key]['cover'] = 'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'; + } + unset($content_list[$key]['ROW_NUMBER']); + } }else{ + foreach ($content_list as $key => $value) { + $content_list[$key]['is_me_like_it'] = 'no'; + if($value['cover'] == null){ + $content_list[$key]['cover'] = 'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'; + } + unset($content_list[$key]['ROW_NUMBER']); + } + } + }else{ + foreach ($content_list as $key => $value) { $content_list[$key]['is_me_like_it'] = 'no'; + if($value['cover'] == null){ + $content_list[$key]['cover'] = 'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'; + } + unset($content_list[$key]['ROW_NUMBER']); } - if($value['cover'] == null){ - $content_list[$key]['cover'] = 'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'; - } - unset($content_list[$key]['ROW_NUMBER']); } + // dump($content_list); + // die; return $this->msg([ 'page_now'=>$page_now, 'page_total'=>$page_total, @@ -599,11 +772,7 @@ class Cookbook extends Base{ ]); } public function cookbook_details_action($data){ - // 获取账号下信息以及用户信息 - $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic')->find(); - if(!$user_data){ - return $this->msg(20001,'账号信息错误'); - } + $cfc = Db::connect('cfc_db'); $img_arr = []; // 查询菜谱详情 @@ -613,9 +782,11 @@ class Cookbook extends Base{ } $cookbook_data['food_data'] = json_decode($cookbook_data['food_data'],true); $cookbook_data['step_data'] = json_decode($cookbook_data['step_data'],true); + // $cookbook_data['food_type'] = explode(',',$cookbook_data['food_type']); $cookbook_data_step_data_count = count($cookbook_data['step_data']); // 设置需要的图片id array_push($img_arr, $cookbook_data['cover']); + foreach ($cookbook_data['step_data'] as $key => $value) { if(count($value['pic_list']) > 0){ foreach ($value['pic_list'] as $k => $v) { @@ -625,6 +796,8 @@ class Cookbook extends Base{ } } } + // dump($cookbook_data); + // die; $img_arr = implode(',',$img_arr); // 查找需要的图片 $img_arr_data = $cfc->table($this->kitchenscale_db_msg['uploadimg'])->where("id in ($img_arr) AND is_del = 0")->field('id,pic_name,pic_url')->select(); @@ -633,79 +806,75 @@ class Cookbook extends Base{ foreach ($img_arr_data as $key => $value) { $cookbook_img_data[$value['id']] = $value['pic_url']; } + // 设置菜谱图片 foreach ($cookbook_data['step_data'] as $key => $value) { - $cookbook_data['step_data'][$key]['pic_list_ls'] = []; + $cookbook_data['step_data'][$key]['step_num'] = "步骤".($key+1).'/'.$cookbook_data_step_data_count; + $cookbook_data['step_data'][$key]['pic_url_list'] = []; foreach ($value['pic_list'] as $k => $v) { if(array_key_exists($v, $cookbook_img_data)){ - array_push($cookbook_data['step_data'][$key]['pic_list_ls'],$cookbook_img_data[$v]); + array_push($cookbook_data['step_data'][$key]['pic_url_list'],$cookbook_img_data[$v]); }else{ - array_push($cookbook_data['step_data'][$key]['pic_list_ls'],'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'); + array_push($cookbook_data['step_data'][$key]['pic_url_list'],'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'); } } - $cookbook_data['step_data'][$key]['pic_list'] = $cookbook_data['step_data'][$key]['pic_list_ls']; - unset($cookbook_data['step_data'][$key]['pic_list_ls']); - $cookbook_data['step_data'][$key]['step_num'] = "步骤".($key+1).'/'.$cookbook_data_step_data_count; } + + // $cookbook_data['cover_id'] = $cookbook_data['cover']; if(array_key_exists($cookbook_data['cover'], $cookbook_img_data)){ - $cookbook_data['cover'] = $cookbook_img_data[$cookbook_data['cover']]; + $cookbook_data['cover_pic_url'] = $cookbook_img_data[$cookbook_data['cover']]; + }else{ - $cookbook_data['cover'] = 'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'; + $cookbook_data['cover_pic_url'] = 'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'; } - // // 处理关注跟收藏信息 - // if($data['token'] == $cookbook_data['create_user_token']){ - // // 如果查询跟作者一致 - // $cookbook_data['follow_status'] = 'myself'; - // $cookbook_data['collect_status'] = 'myself'; - // }else{ - // $follow_data = $cfc->table($this->kitchenscale_db_msg['followlist']) - // ->where([ - // 'follow_user_token'=>$data['token'], - // 'being_follow_user_token'=>$cookbook_data['create_user_token'], - // ]) - // ->find(); - // if($follow_data){ - // if($follow_data['is_del'] == 0){ - // // 如果有结果并且没被删过 - // $cookbook_data['follow_status'] = 'yes'; - // }else{ - // // 如果有结果被删过 - // $cookbook_data['follow_status'] = 'no'; - // } - // }else{ - // // 如果没结果 - // $cookbook_data['follow_status'] = 'no'; - // } + - $collect_data = $cfc->table($this->kitchenscale_db_msg['collect_list']) - ->where([ - 'token'=>$data['token'], - 'cookbook_id'=>$data['cookbook_id'], - ]) - ->find(); - if($collect_data){ - if($collect_data['is_del'] == 0){ - // 如果有结果并且没被删过 - $cookbook_data['collect_status'] = 'yes'; + if(array_key_exists($cookbook_data['cover'], $cookbook_img_data)){ + if($data['token'] != ''){ + // 获取账号下信息以及用户信息 + $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic')->find(); + if(!$user_data){ + return $this->msg(20001,'账号信息错误'); + } + $collect_data = $cfc->table($this->kitchenscale_db_msg['collect_list']) + ->where([ + 'token'=>$data['token'], + 'cookbook_id'=>$data['cookbook_id'], + ]) + ->find(); + if($collect_data){ + if($collect_data['is_del'] == 0){ + // 如果有结果并且没被删过 + $cookbook_data['collect_status'] = 'yes'; + }else{ + // 如果有结果被删过 + $cookbook_data['collect_status'] = 'no'; + } }else{ - // 如果有结果被删过 + // 如果没结果 $cookbook_data['collect_status'] = 'no'; } }else{ - // 如果没结果 $cookbook_data['collect_status'] = 'no'; } - // } - // 添加阅读量 - // $read_num = $cfc->table($this->kitchenscale_db_msg['cookbook'])->where(['id'=>$data['cookbook_id']])->setInc('read_it'); - // if($read_num){ - // $cookbook_data['read_it'] = $cookbook_data['read_it']+1; - // } - // unset($cookbook_data['create_user_token']); + }else{ + $cookbook_data['collect_status'] = 'no'; + } + + + + $cookbook_data['token'] = $cookbook_data['create_user_token']; + $cookbook_data['description'] = $cookbook_data['describe_data']; + $cookbook_data['food_list'] = $cookbook_data['food_data']; + $cookbook_data['step_list'] = $cookbook_data['step_data']; + unset($cookbook_data['create_user_token']); + unset($cookbook_data['describe_data']); + unset($cookbook_data['food_data']); + unset($cookbook_data['step_data']); unset($cookbook_data['create_time']); - unset($cookbook_data['cook_label']); unset($cookbook_data['food_type']); unset($cookbook_data['ROW_NUMBER']); + unset($cookbook_data['is_del']); return $this->msg($cookbook_data); } public function cookbook_follow_action($data){ @@ -866,33 +1035,65 @@ class Cookbook extends Base{ } } public function get_food_list_action($data){ + $cp_page_num = 100; $cfc = Db::connect('cfc_db'); // 获取食材分类列表start - $foodlist1 = $cfc->table($this->kitchenscale_db_msg['foodlist1'])->where("is_del = 0")->field('id,name')->select(); - $foodlist2 = $cfc->table($this->kitchenscale_db_msg['foodlist2'])->where("is_del = 0")->field('id,name,one_id')->select(); - $foodlist3 = $cfc->table($this->kitchenscale_db_msg['foodlist3'])->where("is_del = 0")->field('id,name,two_id,kcal,unit')->select(); - // dump($foodlist3); - foreach ($foodlist1 as $key => $value) { - unset($foodlist1[$key]['ROW_NUMBER']); - $foodlist1[$key]['list'] = []; - foreach ($foodlist2 as $k => $v) { - $foodlist2[$k]['list'] = []; - foreach ($foodlist3 as $k3 => $v3) { - if($v3['two_id'] == $v['id']){ - unset($foodlist3[$k3]['ROW_NUMBER']); - $foodlist3[$k3]['one_id'] = $v['one_id']; - array_push($foodlist2[$k]['list'],$foodlist3[$k3]); - // unset($foodlist3[$k3]); - } - } - if($v['one_id'] == $value['id']){ - unset($foodlist2[$k]['ROW_NUMBER']); - array_push($foodlist1[$key]['list'],$foodlist2[$k]); - // unset($foodlist2[$k]); - } + // $foodlist1 = $cfc->table($this->kitchenscale_db_msg['foodlist1'])->where("is_del = 0")->field('id,name')->select(); + // $foodlist2 = $cfc->table($this->kitchenscale_db_msg['foodlist2'])->where("is_del = 0")->field('id,name,one_id')->select(); + // $foodlist3 = $cfc->table($this->kitchenscale_db_msg['foodlist3'])->where("is_del = 0")->field('id,name,two_id,kcal,unit')->select(); + + $search_sql_str = "is_del = 0 AND two_id = ".$data['food_level2_id']; + if(!array_key_exists('search_data', $data)){ + $data['search_data'] = ""; + }else{ + if($data['search_data'] === ""){ + $data['search_data'] = ""; + }else{ + $data['search_data'] = " AND name LIKE '%".$data['search_data']."%'"; } } - return $this->msg($foodlist1); + $search_sql_str = $search_sql_str.$data['search_data']; + + // dump($data); + // dump($search_sql_str); + $content_num = $cfc->table($this->kitchenscale_db_msg['foodlist3']) + // ->alias('a') + // ->join($this->kitchenscale_db_msg['foodlist2'].' b','a.two_id = b.id','LEFT') + // ->join($this->kitchenscale_db_msg['foodlist1'].' c','b.one_id = c.id','LEFT') + ->where($search_sql_str) + ->count(); + $page_total = ceil($content_num/$cp_page_num);; + $collect_list = $cfc->table($this->kitchenscale_db_msg['foodlist3']) + // ->alias('a') + // ->join($this->kitchenscale_db_msg['foodlist2'].' b','a.two_id = b.id','LEFT') + // ->join($this->kitchenscale_db_msg['foodlist1'].' c','b.one_id = c.id','LEFT') + ->where($search_sql_str) + ->field('id,name,kcal,unit') + ->page($data['page'],$cp_page_num) + ->select(); + // $return_data = []; + // $temporary_arr = []; + // foreach ($collect_list as $key => $value) { + // unset($collect_list[$key]['ROW_NUMBER']); + + // if(!array_key_exists($value['two_id'], $temporary_arr)){ + // $temporary_arr[$value['two_id']] = [ + // 'id'=>$value['two_id'], + // 'name'=>$value['two_name'], + // 'list'=>[['id'=>$value['id'],'name'=>$value['name'],'kcal'=>$value['kcal'],'unit'=>$value['unit']]], + // ]; + // }else{ + // array_push($temporary_arr[$value['two_id']]['list'],['id'=>$value['id'],'name'=>$value['name'],'kcal'=>$value['kcal'],'unit'=>$value['unit']]); + // } + // } + // foreach ($temporary_arr as $key => $value) { + // array_push($return_data,$value); + // } + return $this->msg([ + 'page_now'=>$data['page'], + 'page_total'=>$page_total, + 'content_list'=>$collect_list + ]); } public function get_cookbook_label_list_action(){ $cfc = Db::connect('cfc_db'); @@ -930,38 +1131,44 @@ class Cookbook extends Base{ // 处理食材的卡路里 public function count_calorie($data,$step){ - + $foot_name = array_column($data, 'name'); $foot_name = array_unique($foot_name); $cfc = Db::connect('cfc_db'); - $foot_kcal = $cfc->table($this->kitchenscale_db_msg['foodlist3'])->where("name in ('".implode("','", $foot_name)."')")->field("name,kcal")->select(); + $foot_kcal = $cfc->table($this->kitchenscale_db_msg['foodlist3'])->where("name in ('".implode("','", $foot_name)."')")->field("id,name,kcal")->select(); $foot_kcal2 = []; foreach ($foot_kcal as $key => $value) { - $foot_kcal2[$value['name']] = $value['kcal']; + $foot_kcal2[$value['name']] = [$value['id'],$value['kcal']]; } - + // dump($data); + // dump($foot_kcal2); + // die; foreach ($data as $key => $value) { if(array_key_exists($value['name'], $foot_kcal2)){ - $data[$key]['kcal'] = $this->count_calorie_action($value['weight'],$foot_kcal2[$value['name']]).'kcal'; + $data[$key]['id'] = $foot_kcal2[$value['name']][0]; + $data[$key]['kcal'] = $foot_kcal2[$value['name']][1]; }else{ - $data[$key]['kcal'] = '0kcal'; + $data[$key]['kcal'] = '0'; + $data[$key]['id'] = 0; } - $data[$key]['weight'] = $data[$key]['weight'].'g'; + $data[$key]['unit'] = 'g'; } - // foreach ($step as $key => $value) { - // foreach ($value['foot_list'] as $k => $v) { - // if(array_key_exists($v['name'], $foot_kcal2)){ - // $step[$key]['foot_list'][$k]['kcal'] = $this->count_calorie_action($v['weight'],$foot_kcal2[$v['name']]).'kcal'; - // }else{ - // $step[$key]['foot_list'][$k]['kcal'] = '0kcal'; - // } - // $step[$key]['foot_list'][$k]['weight'] = $step[$key]['foot_list'][$k]['weight'].'g'; + // foreach ($data as $key => $value) { + // if(array_key_exists($value['name'], $foot_kcal2)){ + // // $data[$key]['kcal'] = $this->count_calorie_action($value['weight'],$foot_kcal2[$value['name']]).'kcal'; + // $data[$key]['kcal'] = $this->count_calorie_action($value['weight'],$foot_kcal2[$value['name']]); + // }else{ + // // $data[$key]['kcal'] = '0kcal'; + // $data[$key]['kcal'] = '0'; // } - + // // $data[$key]['weight'] = $data[$key]['weight'].'g'; + // $data[$key]['unit'] = 'g'; + // $data[$key]['id'] = 'g'; // } - return [$data]; + + return $data; } @@ -976,4 +1183,58 @@ class Cookbook extends Base{ } + + public function chuli_shuju(){ + $cfc = Db::connect('cfc_db'); + $foot_kcal = $cfc->table('app_user_cookbook')->field("food_data,id")->select(); + $foot_name = []; + // dump($foot_kcal); + foreach ($foot_kcal as $key => $value) { + unset($foot_kcal[$key]['ROW_NUMBER']); + $foot_kcal[$key]['food_data'] = json_decode($foot_kcal[$key]['food_data'],true); + foreach ($foot_kcal[$key]['food_data'] as $k => $v) { + $linshi_data = $v; + // dump($linshi_data); + $foot_kcal[$key]['food_data'][$k] = []; + $foot_kcal[$key]['food_data'][$k]['name'] = $linshi_data['name']; + $foot_kcal[$key]['food_data'][$k]['weight'] = $linshi_data['weight']; + $foot_kcal[$key]['food_data'][$k]['unit'] = 'g'; + $foot_kcal[$key]['food_data'][$k]['kcal'] = rtrim($linshi_data['kcal'], "kcal"); + if(!in_array($linshi_data['name'], $foot_name)){ + array_push($foot_name,$linshi_data['name']); + } + } + // $foot_kcal[$key]['food_data'] = $foot_kcal[$key]['food_data'][0]; + + // $foot_kcal[$key]['food_data'] = json_encode($foot_kcal[$key]['food_data']); + } + + $shicai = $cfc->table($this->kitchenscale_db_msg['foodlist3'])->where("name in ('".implode("','", $foot_name)."')")->field("id,name,kcal")->select(); + $shicai2 = []; + foreach ($shicai as $key => $value) { + $shicai2[$value['name']] = [$value['id'],$value['kcal']]; + } + // dump($shicai2); + foreach ($foot_kcal as $key => $value) { + foreach ($foot_kcal[$key]['food_data'] as $k => $v) { + $foot_kcal[$key]['food_data'][$k]['kcal'] = $shicai2[$v['name']][1]; + $foot_kcal[$key]['food_data'][$k]['id'] = $shicai2[$v['name']][0]; + } + // $foot_kcal[$key]['food_data'] = $foot_kcal[$key]['food_data'][0]; + + $foot_kcal[$key]['food_data'] = json_encode($foot_kcal[$key]['food_data']); + } + + // dump($foot_kcal); + // die; + foreach ($foot_kcal as $key => $value) { + $cfc->table('app_user_cookbook')->where(['id'=>$value['id']])->update(['food_data'=>$value['food_data']]); + } + dump($foot_kcal); + die; + } + + + + } \ No newline at end of file diff --git a/application/KitchenScale/controller/app/Countfood.php b/application/KitchenScale/controller/app/Countfood.php index 365d58a..c237c9f 100644 --- a/application/KitchenScale/controller/app/Countfood.php +++ b/application/KitchenScale/controller/app/Countfood.php @@ -4,9 +4,11 @@ namespace app\KitchenScale\controller\app; use think\Db; -class Login extends Base{ +class Countfood extends Base{ protected $default_head_pic = 'http://tc.pcxbc.com/tsf/head_pic.png'; + protected $page_num = 10; + protected $reedaw_db_msg = [ 'zhanghao'=>'app_account_number',//账号表 'juese'=>'app_user_data',//角色表 @@ -17,8 +19,8 @@ class Login extends Base{ 'followlist'=>'app_user_follow_list',//关注列表 'collect_list'=>'app_user_collect_list',//收藏列表 'foodlist3'=>'app_food_type_three',//食材列表3 - 'eat_log'=>'',//食材列表3 - + 'eat_log'=>'app_user_kcal_log',//食材列表3 + 'user'=>'app_user_data',//banner ]; // 加 bcadd(,,20) @@ -30,7 +32,7 @@ class Login extends Base{ ################################################################接口################################################################ // 添加每日摄入记录 - public function add_intake_food($data=['token'=>'caadd1be045a65f30b92aa805f1de54a','aud_id'=>1,'meals_type'=>'早餐','food_list'=>[['food_id'=>1,'weight'=>'500'],['food_id'=>1,'weight'=>'500']]]){ + public function add_intake_food($data=['token'=>'caadd1be045a65f30b92aa805f1de54a','aud_id'=>1,'meals_type'=>'午加餐','food_list'=>[['id'=>1,'weight'=>'150','unit'=>'g'],['id'=>2,'weight'=>'100','unit'=>'g']]]){ // 尝试捕获异常 // try { if(count(input('post.')) > 0){ @@ -42,6 +44,9 @@ class Login extends Base{ if(!array_key_exists('aud_id', $data)){ return $this->msg(10001,'aud_id is miss'); } + if(!array_key_exists('meals_type', $data)){ + return $this->msg(10001,'meals_type is miss'); + } if(!array_key_exists('food_list', $data)){ return $this->msg(10001,'food_list is miss'); } @@ -69,7 +74,7 @@ class Login extends Base{ // } } // 获取记食器板块内容 - public function get_countfoot_content($data=['token'=>'caadd1be045a65f30b92aa805f1de54a','aud_id'=>1,'time'=>'2025-03-17']){ + public function get_countfoot_content($data=['token'=>'caadd1be045a65f30b92aa805f1de54a','aud_id'=>61,'time'=>'2025-03-17']){ // 尝试捕获异常 // try { if(count(input('post.')) > 0){ @@ -112,7 +117,7 @@ class Login extends Base{ // } } // 获取记食器记录 - public function get_log_list($data=['token'=>'caadd1be045a65f30b92aa805f1de54a','aud_id'=>1,'page'=>1]){ + public function get_log_list($data=['token'=>'caadd1be045a65f30b92aa805f1de54a','aud_id'=>1,'s_time'=>'2025-03-15','e_time'=>'2025-03-16']){ // 尝试捕获异常 // try { if(count(input('post.')) > 0){ @@ -124,8 +129,11 @@ class Login extends Base{ if(!array_key_exists('aud_id', $data)){ return $this->msg(10001,'aud_id is miss'); } - if(!array_key_exists('page', $data)){ - return $this->msg(10001,'page is miss'); + if(!array_key_exists('s_time', $data)){ + return $this->msg(10001,'s_time is miss'); + } + if(!array_key_exists('e_time', $data)){ + return $this->msg(10001,'e_time is miss'); } if(!$this->verify_data_is_ok($data['token'],'str')){ return $this->msg(10005,'token type is error'); @@ -133,8 +141,11 @@ class Login extends Base{ if(!$this->verify_data_is_ok($data['aud_id'],'intnum')){ return $this->msg(10005,'aud_id type is error'); } - if(!$this->verify_data_is_ok($data['page'],'intnum')){ - return $this->msg(10005,'page type is error'); + if(!$this->verify_data_is_ok($data['s_time'],'datetime')){ + return $this->msg(10005,'s_time type is error'); + } + if(!$this->verify_data_is_ok($data['e_time'],'datetime')){ + return $this->msg(10005,'e_time type is error'); } $return_data = $this->get_log_list_action($data); @@ -154,7 +165,86 @@ class Login extends Base{ // return json(['status' => 'error', 'message' => '系统错误']); // } } - + // 计食器板块-设置内容 + public function set_up_content($data=['token'=>'caadd1be045a65f30b92aa805f1de54a','aud_id'=>61]){ + // 尝试捕获异常 + // try { + if(count(input('post.')) > 0){ + $data = input('post.'); + } + if(!array_key_exists('token', $data)){ + return $this->msg(10001,'token is miss'); + } + if(!array_key_exists('aud_id', $data)){ + return $this->msg(10001,'aud_id is miss'); + } + if(!$this->verify_data_is_ok($data['token'],'str')){ + return $this->msg(10005,'token type is error'); + } + if(!$this->verify_data_is_ok($data['aud_id'],'intnum')){ + return $this->msg(10005,'aud_id type is error'); + } + + $return_data = $this->set_up_content_action($data); + return $return_data; + // } catch (\Exception $e) { + // // 捕获异常 + // $logContent["file"] = $e->getFile(); + // $logContent["line"] = $e->getLine(); + // $logContent['all_content'] = "异常信息:\n"; + // $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; + // $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; + // $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + // $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; + // $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; + // // 记录日志 + // // $this->record_api_log($data, $logContent, null); + // return json(['status' => 'error', 'message' => '系统错误']); + // } + } + // 设置用户的卡路里 + public function set_user_kcal($data=['token'=>'caadd1be045a65f30b92aa805f1de54a','aud_id'=>61,'set_kcal'=>2000]){ + // 尝试捕获异常 + // try { + if(count(input('post.')) > 0){ + $data = input('post.'); + } + if(!array_key_exists('token', $data)){ + return $this->msg(10001,'token is miss'); + } + if(!array_key_exists('aud_id', $data)){ + return $this->msg(10001,'aud_id is miss'); + } + if(!array_key_exists('set_kcal', $data)){ + return $this->msg(10001,'set_kcal is miss'); + } + if(!$this->verify_data_is_ok($data['token'],'str')){ + return $this->msg(10005,'token type is error'); + } + if(!$this->verify_data_is_ok($data['aud_id'],'intnum')){ + return $this->msg(10005,'aud_id type is error'); + } + if(!$this->verify_data_is_ok($data['set_kcal'],'num')){ + return $this->msg(10005,'set_kcal type is error'); + } + + $return_data = $this->set_user_kcal_action($data); + return $return_data; + // } catch (\Exception $e) { + // // 捕获异常 + // $logContent["file"] = $e->getFile(); + // $logContent["line"] = $e->getLine(); + // $logContent['all_content'] = "异常信息:\n"; + // $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; + // $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; + // $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + // $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; + // $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; + // // 记录日志 + // // $this->record_api_log($data, $logContent, null); + // return json(['status' => 'error', 'message' => '系统错误']); + // } + } #######################################################################action####################################################################### #######################################################################action####################################################################### #######################################################################action####################################################################### @@ -165,28 +255,42 @@ class Login extends Base{ public function add_intake_food_action($data){ $cfc = Db::connect('cfc_db'); + $user_data = $cfc->table($this->kitchenscale_db_msg['user']) + ->where(["id"=>$data['aud_id']]) + ->field('weight,height,gender,age,is_use_set_kcal,set_kcal') + ->find(); + if(!$user_data){ + return $this->msg(10003); + } // 统计食物的id $food_id_arr = []; + foreach ($data['food_list'] as $key => $value) { - if(!array_key_exists('food_id', $value)){ - return $this->msg(10001,'food_id is miss'); + if(!array_key_exists('id', $value)){ + return $this->msg(10001,'id is miss'); } if(!array_key_exists('weight', $value)){ return $this->msg(10001,'weight is miss'); } - if(!$this->verify_data_is_ok($value['food_id'],'intnum')){ - return $this->msg(10005,'food_id type is error'); + if(!$this->verify_data_is_ok($value['id'],'intnum')){ + return $this->msg(10005,'id type is error'); } if(!$this->verify_data_is_ok($value['weight'],'num')){ return $this->msg(10005,'weight type is error'); } + foreach ($data['food_list'][$key] as $k => $v) { + // dump($k); + if(!in_array($k,['id','weight','unit'])){ + unset($data['food_list'][$key][$k]); + } + } array_push($food_id_arr,$value['id']); } - $food_content = $cfc->table($this->kitchenscale_db_msg['foodlist3']) ->where("id in (".implode(',',$food_id_arr).")") ->field('id,name,kcal,carbohydrate,protein,fat') ->select(); + // 整理食物信息 $food_content_arr = []; foreach ($food_content as $key => $value) { @@ -201,22 +305,27 @@ class Login extends Base{ $data['food_list'][$key]['carbohydrate_val'] = bcmul($food_content_arr[$value['id']]['carbohydrate'],$proportion_num,2); $data['food_list'][$key]['protein_val'] = bcmul($food_content_arr[$value['id']]['protein'],$proportion_num,2); $data['food_list'][$key]['fat_val'] = bcmul($food_content_arr[$value['id']]['fat'],$proportion_num,2); + $data['food_list'][$key]['food_name'] = $food_content_arr[$value['id']]['name']; $data['food_list'][$key]['aud_id'] = $data['aud_id']; $data['food_list'][$key]['meals_type'] = $data['meals_type']; - $data['food_list'][$key]['food_name'] = $data['meals_type']; $data['food_list'][$key]['create_time'] = $create_time; + $data['food_list'][$key]['food_id'] = $value['id']; + unset($data['food_list'][$key]['id']); + }else{ unset($data['food_list'][$key]); } } + // dump($data['food_list']); + // die; // 数据库数据字段:id,aud_id,meals_type,food_id,food_name,weight,kcal_val,carbohydrate_val,protein_val,fat_val,create_time // 启动事务 Db::startTrans(); try{ - $result = $cfc->table($this->kitchenscale_db_msg['foodlist3'])->insertAll($data['food_list']); - if ($result !== count($data)) { + $result = $cfc->table($this->kitchenscale_db_msg['eat_log'])->insertAll($data['food_list']); + if ($result !== count($data['food_list'])) { Db::rollback(); - return $this->msg(10002); + return $this->msg(10001); } else { Db::commit(); return $this->msg([]); @@ -230,31 +339,34 @@ class Login extends Base{ public function get_countfoot_content_action($data){ $cfc = Db::connect('cfc_db'); - $user_data = Db::table($this->reedaw_db_msg['juese']) - ->where(["id"=>$data['aud_id'],'token'=>$data['token']]) - ->field('weight,height,gender,birthday') + $user_data = $cfc->table($this->kitchenscale_db_msg['user']) + ->where(["id"=>$data['aud_id']]) + ->field('weight,height,gender,age,is_use_set_kcal,set_kcal') ->find(); if(!$user_data){ return $this->msg(10003); } - $user_data['age_num'] = $this->calculate_age($user_data['birthday']); + $user_data['age_num'] = $user_data['age']; $nutrition_data = $this->count_user_nutrition_all($user_data); - + if($user_data['is_use_set_kcal'] == 1){ + $nutrition_data['kcal'] = $user_data['set_kcal']; + } + // 查询用户今日摄入食物 $food_content = $cfc->table($this->kitchenscale_db_msg['eat_log']) - // ->where(["aud_id"=>$data['aud_id'],'create_time'=>['=']]) - ->where("aud_id = ".$data['aud_id']." AND CAST(create_time AS DATE) = ".$data['time']."") + ->where("aud_id = " . $data['aud_id'] . " AND CAST(create_time AS DATE) = CAST('" . $data['time'] . "' AS DATE)") ->field('meals_type,food_name,weight,kcal_val,carbohydrate_val,protein_val,fat_val') ->select(); + $date = date('Y-m-d H:i:s'); $return_data = [ 'suggestion'=>[ - 'kcal'=>$nutrition_data['tdee'], - 'carbohydrate'=>$nutrition_data['carbohydrate'].'克', - 'protein'=>$nutrition_data['protein'].'克', - 'fat'=>$nutrition_data['fat'].'克', + 'kcal'=>$nutrition_data['kcal'], + 'carbohydrate'=>$nutrition_data['carbohydrate'], + 'protein'=>$nutrition_data['protein'], + 'fat'=>$nutrition_data['fat'], ], 'today_intake'=>[ 'kcal'=>0, @@ -262,7 +374,7 @@ class Login extends Base{ 'protein'=>0, 'fat'=>0, ], - 'remaining_kcal'=>$nutrition_data['tdee'],//剩下可摄入卡路里 + 'remaining_kcal'=>$nutrition_data['kcal'],//剩下可摄入卡路里 'list'=>[ [ 'name'=>'早餐', @@ -283,13 +395,19 @@ class Login extends Base{ 'list'=>[], ], [ - 'name'=>'加餐', + 'name'=>'早加餐', 'val'=>0, 'unit'=>'kcal', 'list'=>[], ], [ - 'name'=>'其他', + 'name'=>'午加餐', + 'val'=>0, + 'unit'=>'kcal', + 'list'=>[], + ], + [ + 'name'=>'晚加餐', 'val'=>0, 'unit'=>'kcal', 'list'=>[], @@ -298,79 +416,261 @@ class Login extends Base{ 'date'=>date('Y-m-d'), ]; if(count($food_content) <= 0){ + $return_data['list'] = []; return $this->msg($return_data); } foreach ($food_content as $key => $value) { - $return_data['today_intake']['kcal'] += $value['kcal_val']; - $return_data['today_intake']['carbohydrate'] += $value['carbohydrate_val']; - $return_data['today_intake']['protein'] += $value['protein_val']; - $return_data['today_intake']['fat'] += $value['fat_val']; + $return_data['today_intake']['kcal'] = bcadd($return_data['today_intake']['kcal'],$value['kcal_val'],2); + $return_data['today_intake']['carbohydrate'] = bcadd($return_data['today_intake']['carbohydrate'],$value['carbohydrate_val'],2); + $return_data['today_intake']['protein'] = bcadd($return_data['today_intake']['protein'],$value['protein_val'],2); + $return_data['today_intake']['fat'] = bcadd($return_data['today_intake']['fat'],$value['fat_val'],2); if($value['meals_type'] == '早餐'){ - $return_data['list'][0]['val'] += $value['kcal_val']; + $return_data['list'][0]['val'] = bcadd($return_data['list'][0]['val'],$value['kcal_val'],2); array_push($return_data['list'][0]['list'],['name'=>$value['food_name'],'weight'=>$value['weight'].'克','val'=>$value['kcal_val'].'kcal']); }else if($value['meals_type'] == '午餐'){ - $return_data['list'][1]['val'] += $value['kcal_val']; + $return_data['list'][1]['val'] = bcadd($return_data['list'][1]['val'],$value['kcal_val'],2); array_push($return_data['list'][1]['list'],['name'=>$value['food_name'],'weight'=>$value['weight'].'克','val'=>$value['kcal_val'].'kcal']); }else if($value['meals_type'] == '晚餐'){ - $return_data['list'][2]['val'] += $value['kcal_val']; + $return_data['list'][2]['val'] = bcadd($return_data['list'][2]['val'],$value['kcal_val'],2); array_push($return_data['list'][2]['list'],['name'=>$value['food_name'],'weight'=>$value['weight'].'克','val'=>$value['kcal_val'].'kcal']); - }else if($value['meals_type'] == '加餐'){ - $return_data['list'][3]['val'] += $value['kcal_val']; + }else if($value['meals_type'] == '早加餐'){ + $return_data['list'][3]['val'] = bcadd($return_data['list'][3]['val'],$value['kcal_val'],2); array_push($return_data['list'][3]['list'],['name'=>$value['food_name'],'weight'=>$value['weight'].'克','val'=>$value['kcal_val'].'kcal']); - }else{ - $return_data['list'][4]['val'] += $value['kcal_val']; + }else if($value['meals_type'] == '午加餐'){ + $return_data['list'][4]['val'] = bcadd($return_data['list'][4]['val'],$value['kcal_val'],2); array_push($return_data['list'][4]['list'],['name'=>$value['food_name'],'weight'=>$value['weight'].'克','val'=>$value['kcal_val'].'kcal']); + }else if($value['meals_type'] == '晚加餐'){ + $return_data['list'][5]['val'] = bcadd($return_data['list'][5]['val'],$value['kcal_val'],2); + array_push($return_data['list'][5]['list'],['name'=>$value['food_name'],'weight'=>$value['weight'].'克','val'=>$value['kcal_val'].'kcal']); + }else{ + } } - $return_data['today_intake'] = $return_data['suggestion']['kcal']-$return_data['today_intake']['kcal']>=0?$return_data['suggestion']['kcal']-$return_data['today_intake']['kcal']:0; - return $this->msg($return_data); - } + foreach ($return_data['list'] as $key => $value) { + if(count($value['list']) <= 0){ + unset($return_data['list'][$key]); + } + } + $return_data['list'] = array_values($return_data['list']); + $return_data['remaining_kcal'] = bcsub($return_data['suggestion']['kcal'],$return_data['today_intake']['kcal'],2)>=0?bcsub($return_data['suggestion']['kcal'],$return_data['today_intake']['kcal'],2):0; + return $this->msg($return_data); + + } public function get_log_list_action($data){ $cfc = Db::connect('cfc_db'); - $user_data = Db::table($this->reedaw_db_msg['juese']) - ->where(["id"=>$data['aud_id'],'token'=>$data['token']]) - ->field('weight,height,gender,birthday') + $user_data = $cfc->table($this->kitchenscale_db_msg['user']) + ->where(["id"=>$data['aud_id']]) + ->field('weight,height,gender,age,is_use_set_kcal,set_kcal') + ->find(); + if(!$user_data){ + return $this->msg(10003); + } + // dump($user_data); + // 计算年龄 + $user_data['age_num'] = $user_data['age']; + // 计算推荐营养 + $nutrition_data = $this->count_user_nutrition_all($user_data); + if($user_data['is_use_set_kcal'] == 1){ + $nutrition_data['kcal'] = $user_data['set_kcal']; + } + // 计算取值范围 + // $time_arr = $this->calculateDateRange($data['page']); + + // $content_num = $cfc->query("SELECT COUNT(DISTINCT CONVERT(varchar, create_time, 23)) as total + // FROM ".$this->kitchenscale_db_msg['eat_log']." + // WHERE aud_id = ".$data['aud_id'].""); + // $page_total = ceil($content_num[0]['total']/$this->page_num); + + $food_content = $cfc->table($this->kitchenscale_db_msg['eat_log']) + ->field("CONVERT(varchar, create_time, 23) as create_time, SUM(kcal_val) as kcal_val") + ->where(['aud_id'=>$data['aud_id'],'create_time'=>['>=',$data['s_time'].' 00:00:00'],'create_time'=>['<=',$data['e_time'].' 23:59:59']]) + ->group('CONVERT(varchar, create_time, 23)') + // ->page($data['page'],$this->page_num) + ->order('create_time DESC') + ->select(); + // dump($food_content); + // die; + $user_log = []; + foreach ($food_content as $key => $value) { + $time_data = substr($value['create_time'], 0, 10); + if(array_key_exists($time_data, $user_log)){ + $user_log[$time_data] += $value['kcal_val']; + }else{ + $user_log[$time_data] = $value['kcal_val']; + } + } + $return_data = []; + foreach ($user_log as $key => $value) { + if(bcdiv($value,$nutrition_data['kcal'],2) < 0.9){ + $bz['text'] = '不达标'; + $bz['color'] = '#F0AD4E'; + }else if(bcdiv($value,$nutrition_data['kcal'],2) >= 0.9 && bcdiv($value,$nutrition_data['kcal'],2) < 1.1){ + $bz['text'] = '达标'; + $bz['color'] = '#4CD964'; + }else{ + $bz['text'] = '超标'; + $bz['color'] = '#FF0000'; + } + array_push($return_data,['time'=>$key,'val'=>$value,'unit'=>'kcal','describe'=>$bz['text'],'color'=>$bz['color']]); + } + + // dump($return_data); + return $this->msg([ + // 'page_now'=>$data['page'], + // 'page_total'=>$page_total, + 'content_list'=>$return_data + ]); + } + public function set_up_content_action($data){ + $cfc = Db::connect('cfc_db'); + $user_data = $cfc->table($this->kitchenscale_db_msg['user']) + ->where(["id"=>$data['aud_id']]) + ->field('weight,height,gender,age,is_use_set_kcal,set_kcal') ->find(); if(!$user_data){ return $this->msg(10003); } // 计算年龄 - $user_data['age_num'] = $this->calculate_age($user_data['birthday']); + $user_data['age_num'] = $user_data['age']; // 计算推荐营养 $nutrition_data = $this->count_user_nutrition_all($user_data); - // 计算取值范围 - $time_arr = $this->calculateDateRange($data['page']); - - $food_content = $cfc->table($this->kitchenscale_db_msg['eat_log']) - ->where(['aud_id'=>$data['aud_id']]) - ->whereTime('create_time', 'between', [$time_arr['s_time'], $time_arr['e_time']]) - ->field('kcal_val,create_time') - ->order('create_time desc') - ->select(); - $user_log = []; - foreach ($food_content as $key => $value) { - if(array_key_exists($value['create_time'], $user_log)){ - $user_log[$value['create_time']] += $value['kcal_val']; - }else{ - $user_log[$value['create_time']] = $value['kcal_val']; - } + if($user_data['is_use_set_kcal'] == 1){ + $nutrition_data['kcal'] = $user_data['set_kcal']; } - $return_data = []; - foreach ($variable as $key => $value) { - if(bcdiv($value,$nutrition_data['kcal'],2) < 0.9){ - $bz['text'] = '不达标'; - $bz['color'] = '#F1D452'; - }else if(bcdiv($value,$nutrition_data['kcal'],2) >= 0.9 && bcdiv($value,$nutrition_data['kcal'],2) < 1.1){ - $bz['text'] = '达标'; - $bz['color'] = '#66AE00'; - }else{ - $bz['text'] = '超标'; - $bz['color'] = '#D7001A'; - } - array_push($return_data,['time'=>$key,'val'=>$value,'unit'=>'kcal','describe'=>$bz['text'],'color'=>$bz['color']]); + $nutrition_describe = [ + [ + '对于一个孩子(2-18岁)(没有特殊健康问题),身体处于快速生长发育阶段,需要充足的营养支持,尤其是蛋白质和健康脂肪。通常建议的三大营养素比例为:', + '1、碳水化合物:45%-65% 的总热量', + '提供能量,支持孩子的日常活动和生长发育。', + '优先选择复合碳水化合物(如全谷物、蔬菜、水果),避免精制糖和高糖零食。', + '2、蛋白质:10%-30% 的总热量', + '支持肌肉、骨骼和器官的发育。', + '建议摄入优质蛋白质来源,如瘦肉、鱼类、鸡蛋、豆类和乳制品。', + '蛋白质需求较高,尤其是青春期孩子。', + '3、脂肪:25%-35% 的总热量', + '提供能量,并支持大脑发育(尤其是Omega-3脂肪酸)。', + '优先选择健康脂肪,如鱼类、坚果、种子、橄榄油和牛油果。', + '避免反式脂肪和过多的饱和脂肪。', + '注意事项', + '如果你有特定的健康目标(如增高,减重),可以进一步调整比例,并咨询营养师或医生以获得个性化建议。', + ], + [ + '对于一个正常成年人(没有特殊健康问题或特定健身目标),通常建议的三大营养素比例为:', + '1、碳水化合物:45%-65% 的总热量', + '主要功能是提供能量', + '建议选择复合碳水化合物(如全谷物、蔬菜、豆类),而不是精制糖。', + '对于普通人,碳水化合物占总热量的 50%-55% 是一个常见的推荐值。', + '2、蛋白质:10%-35% 的总热量', + '用于维持肌肉、修复组织和支持免疫功能。', + '普通人每日蛋白质摄入量建议为 0.8-1.2克/公斤体重。', + '对于活动量较大或健身人群,蛋白质比例可以提高到 20%-30%。', + '3、脂肪:20%-35% 的总热量', + '提供能量、支持细胞功能并帮助吸收脂溶性维生素。', + '建议以 不饱和脂肪(如橄榄油、坚果、鱼类)为主,减少饱和脂肪和反式脂肪的摄入。', + '脂肪占总热量的 20%-30% 是常见的推荐值。', + '以上是根据世界卫生组织(WHO)和其他健康机构的建议制定的。具体比例可以根据个人的活动水平、健康状况和目标进行微调。', + '注意事项', + '活动水平:活动量大的人可能需要更多的碳水化合物来提供能量,而健身人群可能需要更多的蛋白质。', + '健康状况:例如,糖尿病患者可能需要控制碳水化合物比例,而心血管疾病患者可能需要减少脂肪摄入。', + '个体差异:每个人的代谢和需求不同,建议根据个人情况调整。', + '如果你有特定的健康目标(如减脂、增肌或控制慢性病),可以进一步调整比例,并咨询营养师或医生以获得个性化建议。', + ], + [ + '对于一个老人(65岁以上)(没有特殊健康问题),身体的代谢率下降,肌肉量减少,可能面临营养不良或慢性病风险,因此需要调整营养比例。通常建议的三大营养素比例为:', + '1、碳水化合物:45%-65% 的总热量', + '提供能量,但应选择低血糖指数(GI)的食物,如全谷物、蔬菜和豆类,以控制血糖水平。', + '避免精制糖和高糖食物,尤其是糖尿病患者。', + '帮助维持肌肉质量,预防肌肉流失(少肌症)。', + '建议摄入优质蛋白质,如鱼类、瘦肉、鸡蛋、豆类和乳制品。', + '蛋白质需求较高,尤其是活动量较大的老人。', + '3、脂肪:20%-35% 的总热量', + '提供能量,并支持细胞功能和脂溶性维生素的吸收。', + '优先选择不饱和脂肪,如橄榄油、坚果、种子和鱼类。', + '减少饱和脂肪和反式脂肪的摄入,以降低心血管疾病风险。', + '注意事项', + '如果你有特定的健康目标(控制慢性病),可以进一步调整比例,并咨询营养师或医生以获得个性化建议。', + ] + ]; + $return_data = [ + 'kcal'=>[ + 'title'=>"建议摄入卡路里", + 'suggestion_kcal_val'=>$nutrition_data['kcal'], + 'suggestion_kcal_unit'=>"千卡", + 'suggestion_kcal_range_val'=>"建议您在:".bcmul($nutrition_data['bmr'],1.2,2)."~".bcmul($nutrition_data['bmr'],1.9,2)."千卡范围内调整,修改时请以医生建议为准!", + 'describe'=>[ + '基础代谢率(BMR):是指人体在清醒而又极端安静的状态下,不受肌肉活动、环境温度、食物及精神紧张等影响时的能量代谢率。', + '每日总能量消耗(TDEE):', + 'TDEE是BMR乘以活动系数,活动系数根据日常活动水平确定', + '久坐(很少或没有运动):BMR × 1.2', + '轻度活动(每周1-3天轻度运动):BMR × 1.375', + '中度活动(每周3-5天中度运动):BMR × 1.55', + '高度活动(每周6-7天高强度运动):BMR × 1.725', + '极高活动(体力劳动或每天高强度训练):BMR × 1.9', + '您的BMR为'.$nutrition_data['bmr'].',建议根据您的日常生活水平,调整合适的TDEE', + ], + ], + 'nutrition'=>[ + 'title'=>"建议三大营养比例", + 'list'=>[ + [ + 'name'=>'碳水化合物', + 'icon'=>'icon-tanshuihuahewu', + 'proportion'=>'50%', + 'val'=>$nutrition_data['carbohydrate'], + 'unit'=>'克' + ], + [ + 'name'=>'蛋白质', + 'icon'=>'icon-Sm-danbaizhi', + 'proportion'=>'20%', + 'val'=>$nutrition_data['protein'], + 'unit'=>'克' + ], + [ + 'name'=>'脂肪', + 'icon'=>'icon-w_fat_normal', + 'proportion'=>'30%', + 'val'=>$nutrition_data['fat'], + 'unit'=>'克' + ] + ], + 'describe'=>[] + ] + ]; + if($user_data['age_num'] >= 2 && $user_data['age_num'] <= 18){ + $return_data['nutrition']['describe'] = $nutrition_describe[0]; + }else if($user_data['age_num'] > 18 && $user_data['age_num'] < 65){ + $return_data['nutrition']['describe'] = $nutrition_describe[1]; + }else if($user_data['age_num'] >= 65){ + $return_data['nutrition']['describe'] = $nutrition_describe[2]; + }else{ + } return $this->msg($return_data); + + } + public function set_user_kcal_action($data){ + $cfc = Db::connect('cfc_db'); + $user_data = $cfc->table($this->kitchenscale_db_msg['user']) + ->where(["id"=>$data['aud_id']]) + ->field('weight,height,gender,age,is_use_set_kcal,set_kcal') + ->find(); + if(!$user_data){ + return $this->msg(10003); + } + $result = $cfc->table($this->kitchenscale_db_msg['user']) + ->where(["id"=>$data['aud_id']]) + ->update([ + 'is_use_set_kcal'=>1, + 'set_kcal'=>$data['set_kcal'] + ]); + + if($result){ + return $this->msg([]); + }else{ + return $this->msg(10002); + } } #######################################################################工具####################################################################### @@ -384,13 +684,13 @@ class Login extends Base{ $bmr = bcmul(10,$data['weight'],20); $bmr = bcadd($bmr,bcmul(6.25,$data['height'],20),20); $bmr = bcsub($bmr,bcmul(5,$data['age_num'],20),20); - $bmr = bcadd($bmr,5,20); + $bmr = bcadd($bmr,5,2); }else if($data['gender'] == 2){ // 女性:BMR = 10 × 体重(kg) + 6.25 × 身高(cm) - 5 × 年龄(岁) - 161 $bmr = bcmul(10,$data['weight'],20); $bmr = bcadd($bmr,bcmul(6.25,$data['height'],20),20); $bmr = bcsub($bmr,bcmul(5,$data['age_num'],20),20); - $bmr = bcsub($bmr,161,20); + $bmr = bcsub($bmr,161,2); }else{ return $this->msg(10003,'性别未知'); } @@ -420,19 +720,19 @@ class Login extends Base{ $protein = bcdiv(bcmul($tdee,0.25,20),4,2); $fat =bcdiv(bcmul($tdee,0.25,20),9,2); } - return ['kcal'=>$tdee,'carbohydrate'=>$carbohydrate,'protein'=>$protein,'fat'=>$fat]; + return ['kcal'=>$tdee,'carbohydrate'=>$carbohydrate,'protein'=>$protein,'fat'=>$fat,'bmr'=>$bmr]; } public function calculateDateRange($n) { // 获取当前日期和时间 - $today = new DateTime(); + $today = new \DateTime(); // 计算结束时间:往前推 (10 * (n - 1)) 天,时间设为 23:59:59 - $endInterval = new DateInterval('P' . (10 * ($n - 1)) . 'D'); + $endInterval = new \DateInterval('P' . (10 * ($n - 1)) . 'D'); $endTime = clone $today; $endTime->sub($endInterval)->setTime(23, 59, 59); // 计算开始时间:往前推 (10 * n) 天,时间设为 00:00:00 - $startInterval = new DateInterval('P' . (10 * $n) . 'D'); + $startInterval = new \DateInterval('P' . (10 * $n) . 'D'); $startTime = clone $today; $startTime->sub($startInterval)->setTime(0, 0, 0); diff --git a/application/KitchenScale/controller/app/Index.php b/application/KitchenScale/controller/app/Index.php index dac3493..10ff122 100644 --- a/application/KitchenScale/controller/app/Index.php +++ b/application/KitchenScale/controller/app/Index.php @@ -3,6 +3,7 @@ namespace app\KitchenScale\controller\app; use think\Db; +// use app\KitchenScale\controller\app\Wechat;// 引入Wechat服务类 class Index extends Base{ @@ -23,6 +24,7 @@ class Index extends Base{ 'collect_list'=>'app_user_collect_list',//点赞表 'banner'=>'app_banner_data',//banner 'version'=>'app_version_log',//版本表 + 'user'=>'app_user_data',//banner ]; @@ -75,18 +77,96 @@ class Index extends Base{ } } + // 微信手机号快捷登录 + public function wechat_quick_login($data = ['code'=>'asdasdasd','encryptedData'=>'adsadasdasd','iv'=>'asdasdasdasd']){ + try { + // 你的业务逻辑 + if(count(input('post.')) > 0){ + $data = input('post.'); + } + if(!array_key_exists('code', $data)){ + // return $this->msg(10001,''); + return $this->msg(10001,'code is miss'); + } + if(!array_key_exists('encryptedData', $data)){ + return $this->msg(10001,'encryptedData is miss'); + } + if(!array_key_exists('iv', $data)){ + return $this->msg(10001,'iv is miss'); + } + // 校验参数 + if (empty($data['code'])) { + return $this->msg(10001,'code is miss.'); + } + if (empty($data['encryptedData'])) { + return $this->msg(10001,'encryptedData is miss.'); + } + if (empty($data['iv'])) { + return $this->msg(10001,'iv is miss.'); + } + + // 调用Wechat服务类处理微信登录逻辑 + $wechatService = new Wechat(); + // die; + $result = $wechatService->handleWechatLogin($data['code'], $data['encryptedData'], $data['iv']); + // dump($result); + // die; + if($result['code'] == 0){ + // return $this->msg($result['code'],$result['msg']); + + $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['tel'=>$result['data']['phoneNumber'],'is_del'=>0])->find(); + + if($user_data){ + Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$user_data['token']])->update(['login_time'=>date('Y-m-d H:i:s')]); + $return_data = $this->msg(['token'=>$user_data['token'],'aan_id'=>$user_data['id']]); + }else{ + $set_data['password'] = ''; + $set_data['tel'] = $result['data']['phoneNumber']; + $set_data['head_pic'] = $this->default_head_pic; + $set_data['nickname'] = '用户'.$result['data']['phoneNumber']; + $set_data['create_time'] = date('Y-m-d H:i:s'); + $set_data['login_time'] = date('Y-m-d H:i:s'); + $set_data['token'] = md5($result['data']['phoneNumber'].$this->create_random_string(12).time()); + $set_user_result = Db::table($this->reedaw_db_msg['zhanghao'])->insertGetId($set_data); + if($set_user_result){ + $return_data = $this->msg(['token'=>$set_data['token'],'aan_id'=>$set_user_result],'登录成功'); + }else{ + $return_data = $this->msg(10002); + } + } + return $return_data; + }else{ + return $this->msg($result['code'],$result['msg']); + } + + } catch (\Exception $e) { + // 捕获异常 + $logContent["flie"] = $e->getFile(); + $logContent["line"] = $e->getLine(); + $logContent['all_content'] = "异常信息:\n"; + $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; + $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; + $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + $logContent['all_content'] .= "方法: (wechat_quick_login)" . "\n"; + $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; + $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; + $this->record_api_log($data, $logContent, null); + return $this->msg(99999); + } + } + // 获取默认配置信息(包含:食材的分类列表,用户角色信息)(OK) - public function get_default_config($data = ['token'=>'caadd1be045a65f30b92aa805f1de54a']){ + public function get_default_config($data = ['token'=>'']){ // try { if(count(input('post.')) > 0){ $data = input('post.'); } - if(!array_key_exists('token', $data)){ - return $this->msg(10001); - } - if(!$this->verify_data_is_ok($data['token'],'str')){ - return $this->msg(10005); - } + // if(!array_key_exists('token', $data)){ + // return $this->msg(10001); + // } + // if(!$this->verify_data_is_ok($data['token'],'str')){ + // return $this->msg(10005); + // } $return_data = $this->get_default_config_action($data); return $return_data; // } catch (\Exception $e) { @@ -105,55 +185,19 @@ class Index extends Base{ // } } - // 获取首页信息(banner,金刚区,label_list)(OK) - public function get_homepage_information($data = ['token'=>'caadd1be045a65f30b92aa805f1de54a']){ - // try { - // 你的业务逻辑 - if(count(input('post.')) > 0){ - $data = input('post.'); - } - if(!array_key_exists('token', $data)){ - return $this->msg(10001); - } - if(!$this->verify_data_is_ok($data['token'],'str')){ - return $this->msg(10005); - } - $return_data = $this->get_homepage_information_action($data); - // 成功 - $this->record_api_log($data, null, $return_data); - return $return_data; - // } catch (\Exception $e) { - // // 捕获异常 - // $logContent["flie"] = $e->getFile(); - // $logContent["line"] = $e->getLine(); - // $logContent['all_content'] = "异常信息:\n"; - // $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; - // $logContent['all_content'] .= "接口: (get_homepage_information)\n"; - // $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; - // $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; - // $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; - // $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; - // $this->record_api_log($data, $logContent, null); - // return $this->msg(99999); - // } - } - // 首页搜索接口(OK) - public function search_column($data = ['search_data'=>'鱼','token'=>'caadd1be045a65f30b92aa805f1de54a']){ + public function search_column($data = ['search_data'=>'鱼','token'=>'']){ // try { // 你的业务逻辑 if(count(input('post.')) > 0){ $data = input('post.'); } - if(!array_key_exists('search_data', $data) || !array_key_exists('token', $data)){ + if(!array_key_exists('search_data', $data)){ return $this->msg(10001); } if(!$this->verify_data_is_ok($data['search_data'],'str')){ return $this->msg(10005); } - if(!$this->verify_data_is_ok($data['token'],'str')){ - return $this->msg(10005); - } $return_data = $this->search_column_action($data); return $return_data; // } catch (\Exception $e) { @@ -177,45 +221,36 @@ class Index extends Base{ #######################################################################action####################################################################### public function get_default_config_action($data){ - // 获取账号下信息以及用户信息 - $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic')->find(); - if(!$user_data){ - return $this->msg(20001,'账号信息错误'); - } - $return_data = [ - // 'food_list'=>[], - // 'cook_label'=>[], - 'account'=>[], - ]; - + $return_data = [ + 'cook_label'=>[], + // 'account'=>[], + 'food_list'=>[], + 'banner'=>[], + 'jingang_region'=>[ + ['name'=>'菜谱分类','jump_url'=>'/pages/menu/menu','icon'=>'https://tc.pcxbc.com/kitchenscale_all/vajra1.png'], + ['name'=>'我的收藏','jump_url'=>'/pageTwo/me/mymenu','icon'=>'https://tc.pcxbc.com/kitchenscale_all/vajra2.png'], + ['name'=>'热量计算','jump_url'=>'/pages/count/count','icon'=>'https://tc.pcxbc.com/kitchenscale_all/vajra3.png'], + ['name'=>'健康食谱','jump_url'=>'/pages/menu/menu','icon'=>'https://tc.pcxbc.com/kitchenscale_all/vajra4.png'], + ], + ]; $cfc = Db::connect('cfc_db'); // // 获取食材分类列表start - // $foodlist1 = $cfc->table($this->kitchenscale_db_msg['foodlist1'])->where("is_del = 0")->field('id,name')->select(); - // $foodlist2 = $cfc->table($this->kitchenscale_db_msg['foodlist2'])->where("is_del = 0")->field('id,name,one_id')->select(); - // $foodlist3 = $cfc->table($this->kitchenscale_db_msg['foodlist3'])->where("is_del = 0")->field('id,name,two_id,kcal')->select(); - // // dump($foodlist3); - // foreach ($foodlist1 as $key => $value) { - // unset($foodlist1[$key]['ROW_NUMBER']); - // $foodlist1[$key]['list'] = []; - // foreach ($foodlist2 as $k => $v) { - // $foodlist2[$k]['list'] = []; - // foreach ($foodlist3 as $k3 => $v3) { - // if($v3['two_id'] == $v['id']){ - // unset($foodlist3[$k3]['ROW_NUMBER']); - // $foodlist3[$k3]['one_id'] = $v['one_id']; - // array_push($foodlist2[$k]['list'],$foodlist3[$k3]); - // // unset($foodlist3[$k3]); - // } - // } - // if($v['one_id'] == $value['id']){ - // unset($foodlist2[$k]['ROW_NUMBER']); - // array_push($foodlist1[$key]['list'],$foodlist2[$k]); - // // unset($foodlist2[$k]); - // } - // } - // } - // $return_data['food_list'] = $foodlist1; + $foodlist1 = $cfc->table($this->kitchenscale_db_msg['foodlist1'])->where("is_del = 0")->field('id,name')->select(); + $foodlist2 = $cfc->table($this->kitchenscale_db_msg['foodlist2'])->where("is_del = 0")->field('id,name,one_id')->select(); + // dump($foodlist3); + foreach ($foodlist1 as $key => $value) { + unset($foodlist1[$key]['ROW_NUMBER']); + $foodlist1[$key]['list'] = []; + foreach ($foodlist2 as $k => $v) { + if($v['one_id'] == $value['id']){ + unset($foodlist2[$k]['ROW_NUMBER']); + array_push($foodlist1[$key]['list'],$foodlist2[$k]); + // unset($foodlist2[$k]); + } + } + } + $return_data['food_list'] = $foodlist1; // // 获取食材分类列表end // 获取菜谱分类标签start $cook_label = $cfc->table($this->kitchenscale_db_msg['cookbook_label']) @@ -227,76 +262,56 @@ class Index extends Base{ } $return_data['cook_label'] = $cook_label; // 获取菜谱分类标签end - // 获取账号下信息以及用户信息start - $user_account = Db::table($this->reedaw_db_msg['zhanghao']) - ->alias('zhanghao') - ->join($this->reedaw_db_msg['juese'].' juese','zhanghao.id = juese.aan_id','LEFT') - ->where(["zhanghao.token"=>$data['token'],'juese.is_del'=>0]) - ->field('juese.id as aud_id,juese.nickname,juese.birthday,juese.gender,juese.grade,juese.head_pic') - ->select(); - $return_data['account'] = $user_account; - // 获取账号下信息以及用户信息end - return $this->msg($return_data); - } - public function get_homepage_information_action($data){ - - // 获取账号下信息以及用户信息 - $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic')->find(); - if(!$user_data){ - return $this->msg(20001,'账号信息错误'); - } - $return_data = [ - 'banner'=>[], - 'jingang_region'=>[ - ['name'=>'菜谱分类','jump_url'=>'/xxx/xxx/xxx','icon'=>'/xxx/xxx/xxx'], - ['name'=>'我的收藏','jump_url'=>'/xxx/xxx/xxx','icon'=>'/xxx/xxx/xxx'], - ['name'=>'热量计算','jump_url'=>'/xxx/xxx/xxx','icon'=>'/xxx/xxx/xxx'], - ['name'=>'健康食谱','jump_url'=>'/xxx/xxx/xxx','icon'=>'/xxx/xxx/xxx'], - ], - ]; - $cfc = Db::connect('cfc_db'); - + // 获取首页信息start // 获取banner - $banner_list = $cfc->query("select b.id,b.title,b.cover,b.create_user_head_pic,b.create_user_nickname + $banner_list = $cfc->query("select b.id,b.title,b.cover,b.create_user_head_pic,b.create_user_nickname,c.pic_url from ".$this->kitchenscale_db_msg['banner']." as a - LEFT JOIN ".$this->kitchenscale_db_msg['cookbook']." as b - on a.cookbook_id = b.id - where a.is_del=0 + LEFT JOIN ".$this->kitchenscale_db_msg['cookbook']." as b on a.cookbook_id = b.id + LEFT JOIN ".$this->kitchenscale_db_msg['uploadimg']." as c on b.cover = c.id + where a.is_del=0 AND b.is_del=0 ORDER BY a.sort_num desc,a.id desc "); - $collect_list = $cfc->table($this->kitchenscale_db_msg['collect_list'])->where(['token'=>$data['token']])->column('cookbook_id'); - - - foreach ($banner_list as $key => $value) { - if(array_key_exists($value['id'],$collect_list)){ - $banner_list[$key]['is_me_like_it'] = 1; - }else{ - $banner_list[$key]['is_me_like_it'] = 0; + // dump($banner_list); + // die; + if($data['token'] != ''){ + // 获取账号下信息以及用户信息 + $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic,tel,email')->find(); + if(!$user_data){ + return $this->msg(20001,'账号信息错误'); + } + if(!$this->verify_data_is_ok($data['token'],'str')){ + return $this->msg(10005); + } + // 获取账号下信息以及用户信息 + $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic')->find(); + if(!$user_data){ + return $this->msg(20001,'账号信息错误'); + } + $collect_list = $cfc->table($this->kitchenscale_db_msg['collect_list'])->where(['token'=>$data['token'],'is_del'=>0])->column('cookbook_id'); + foreach ($banner_list as $key => $value) { + if(array_key_exists($value['id'],$collect_list)){ + $banner_list[$key]['is_me_like_it'] = 'yes'; + }else{ + $banner_list[$key]['is_me_like_it'] = 'no'; + } + unset($banner_list[$key]['ROW_NUMBER']); + } + }else{ + foreach ($banner_list as $key => $value) { + $banner_list[$key]['is_me_like_it'] = 'no'; + unset($banner_list[$key]['ROW_NUMBER']); } - unset($banner_list[$key]['ROW_NUMBER']); } $return_data['banner'] = $banner_list; - - - // 获取菜谱列表 - // $label_list = $cfc->query("select id,name from ".$this->kitchenscale_db_msg['cookbook_label']." where is_del=0 ORDER BY id"); - // if(count($label_list) <= 0){ - // $return_data['label_list'] = []; - // return $this->msg($return_data); - // } - // $return_data['label_list'] = $label_list; + // return $this->msg($return_data); + // 获取首页信息end return $this->msg($return_data); - - } + public function search_column_action($data){ - // 获取账号下信息以及用户信息 - $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic')->find(); - if(!$user_data){ - return $this->msg(20001,'账号信息错误'); - } + // $cookbook = new Cookbook(); $cfc = Db::connect('cfc_db'); // 获取菜谱信息 @@ -309,25 +324,70 @@ class Index extends Base{ if(count($content_list)<=0){ return $this->msg([]); } - // 获取用户收藏列表 - $my_collect_list = $cfc->table($this->kitchenscale_db_msg['collect_list']) - ->where(['token'=>$data['token']]) - ->column('cookbook_id'); - // dump(); - // 处理菜谱收藏信息 - foreach ($content_list as $key => $value) { - if(array_key_exists($value['id'],$my_collect_list)){ - $content_list[$key]['is_me_like_it'] = 1; + if(array_key_exists('token',$data)){ + if($data['token'] != ''){ + // 获取账号下信息以及用户信息 + $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic')->find(); + if(!$user_data){ + return $this->msg(20001,'账号信息错误'); + } + // 获取用户收藏列表 + $my_collect_list = $cfc->table($this->kitchenscale_db_msg['collect_list']) + ->where(['token'=>$data['token']]) + ->column('cookbook_id'); + // dump(); + // 处理菜谱收藏信息 + foreach ($content_list as $key => $value) { + if(array_key_exists($value['id'],$my_collect_list)){ + $content_list[$key]['is_me_like_it'] = 'yes'; + }else{ + $content_list[$key]['is_me_like_it'] = 'no'; + } + if($value['cover'] == null){ + $content_list[$key]['cover'] = 'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'; + } + unset($content_list[$key]['ROW_NUMBER']); + } }else{ - $content_list[$key]['is_me_like_it'] = 0; + foreach ($content_list as $key => $value) { + $content_list[$key]['is_me_like_it'] = 'no'; + if($value['cover'] == null){ + $content_list[$key]['cover'] = 'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'; + } + unset($content_list[$key]['ROW_NUMBER']); + } } - if($value['cover'] == null){ - $content_list[$key]['cover'] = 'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'; + }else{ + foreach ($content_list as $key => $value) { + $content_list[$key]['is_me_like_it'] = 'no'; + if($value['cover'] == null){ + $content_list[$key]['cover'] = 'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'; + } + unset($content_list[$key]['ROW_NUMBER']); } - unset($content_list[$key]['ROW_NUMBER']); } - return $this->msg($content_list); } + + + + ######################################################################################################################################################################## + ######################################################################################################################################################################## + ######################################################################################################################################################################## + + + + + public function create_random_string($length = 12) + { + //创建随机字符 + $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + $str = ""; + for ($i = 0; $i < $length; $i++) { + $str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1); + } + return $str; + } + } \ No newline at end of file diff --git a/application/KitchenScale/controller/app/Usercenter.php b/application/KitchenScale/controller/app/Usercenter.php index dc211ca..60eea7a 100644 --- a/application/KitchenScale/controller/app/Usercenter.php +++ b/application/KitchenScale/controller/app/Usercenter.php @@ -23,6 +23,7 @@ class Usercenter extends Base{ 'foodlist3'=>'app_food_type_three',//食材列表3 'collect_list'=>'app_user_collect_list',//点赞表 'banner'=>'app_banner_data',//banner + 'user'=>'app_user_data',//banner ]; @@ -34,6 +35,95 @@ class Usercenter extends Base{ ################################################################接口################################################################ ################################################################接口################################################################ + // 获取角色信息 + public function get_user_msg($data = ['token'=>'caadd1be045a65f30b92aa805f1de54a']){ + // try { + if(count(input('post.')) > 0){ + $data = input('post.'); + } + if(!array_key_exists('token', $data)){ + return $this->msg(10001); + } + if(!$this->verify_data_is_ok($data['token'],'str')){ + return $this->msg(10005); + } + $return_data = $this->get_user_msg_action($data); + return $return_data; + // } catch (\Exception $e) { + // // 捕获异常 + // $logContent["flie"] = $e->getFile(); + // $logContent["line"] = $e->getLine(); + // $logContent['all_content'] = "异常信息:\n"; + // $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; + // $logContent['all_content'] .= "接口: (get_default_config)\n"; + // $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; + // $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + // $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; + // $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; + // $this->record_api_log($data, $logContent, null); + // return $this->msg(99999); + // } + } + // 修改用户 + public function update_user_msg($data = ['token'=>'caadd1be045a65f30b92aa805f1de54a','nickname'=>'测试人员001','gender'=>'1','age'=>'18','height'=>'165.34','weight'=>'55.55']){ + // try { + if(count(input('post.')) > 0){ + $data = input('post.'); + } + if(!array_key_exists('token', $data)){ + return $this->msg(10001,'token is miss'); + } + if(!array_key_exists('nickname', $data)){ + return $this->msg(10001,'nickname is miss'); + } + if(!array_key_exists('gender', $data)){ + return $this->msg(10001,'gender is miss'); + } + if(!array_key_exists('age', $data)){ + return $this->msg(10001,'age is miss'); + } + if(!array_key_exists('height', $data)){ + return $this->msg(10001,'height is miss'); + } + if(!array_key_exists('weight', $data)){ + return $this->msg(10001,'weight is miss'); + } + if(!$this->verify_data_is_ok($data['token'],'str')){ + return $this->msg(10005,'token type is error'); + } + if(!$this->verify_data_is_ok($data['nickname'],'str')){ + return $this->msg(10005,'nickname type is error'); + } + if(!$this->verify_data_is_ok($data['gender'],'intnum')){ + return $this->msg(10005,'gender type is error'); + } + if(!$this->verify_data_is_ok($data['age'],'intnum')){ + return $this->msg(10005,'age type is error'); + } + if(!$this->verify_data_is_ok($data['height'],'num')){ + return $this->msg(10005,'height type is error'); + } + if(!$this->verify_data_is_ok($data['weight'],'num')){ + return $this->msg(10005,'weight type is error'); + } + $return_data = $this->update_user_msg_action($data); + return $return_data; + // } catch (\Exception $e) { + // // 捕获异常 + // $logContent["flie"] = $e->getFile(); + // $logContent["line"] = $e->getLine(); + // $logContent['all_content'] = "异常信息:\n"; + // $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; + // $logContent['all_content'] .= "接口: (get_default_config)\n"; + // $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; + // $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + // $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; + // $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; + // $this->record_api_log($data, $logContent, null); + // return $this->msg(99999); + // } + } + // 获取用户收藏点赞列表(OK) public function get_user_collect_list($data = ['token'=>'caadd1be045a65f30b92aa805f1de54a','page'=>1,'search_data'=>'']){ // try { @@ -71,7 +161,7 @@ class Usercenter extends Base{ } // 我的菜谱 - public function get_my_cookbook($data = ['token'=>'caadd1be045a65f30b92aa805f1de54a','page'=>1]){ + public function get_my_cookbook($data = ['token'=>'caadd1be045a65f30b92aa805f1de54a','page'=>1,'search_data'=>'']){ // try { if(count(input('post.')) > 0){ $data = input('post.'); @@ -106,17 +196,171 @@ class Usercenter extends Base{ // } } + // 菜谱删除 + public function del_my_cookbook($data = ['token'=>'caadd1be045a65f30b92aa805f1de54a','aud_id'=>1,'cookbook_id'=>'33']){ + // try { + if(count(input('post.')) > 0){ + $data = input('post.'); + } + if(!array_key_exists('token', $data)){ + return $this->msg(10001,'token is miss'); + } + if(!array_key_exists('aud_id', $data)){ + return $this->msg(10001,'aud_id is miss'); + } + if(!array_key_exists('cookbook_id', $data)){ + return $this->msg(10001,'cookbook_id is miss'); + } + if(!$this->verify_data_is_ok($data['token'],'str')){ + return $this->msg(10005,'token type is error'); + } + if(!$this->verify_data_is_ok($data['aud_id'],'intnum')){ + return $this->msg(10005,'aud_id type is error'); + } + if(!$this->verify_data_is_ok($data['cookbook_id'],'intnum')){ + return $this->msg(10005,'cookbook_id type is error'); + } + $return_data = $this->del_my_cookbook_action($data); + return $return_data; + // } catch (\Exception $e) { + // // 捕获异常 + // $logContent["flie"] = $e->getFile(); + // $logContent["line"] = $e->getLine(); + // $logContent['all_content'] = "异常信息:\n"; + // $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; + // $logContent['all_content'] .= "接口: (get_default_config)\n"; + // $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; + // $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + // $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; + // $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; + // $this->record_api_log($data, $logContent, null); + // return $this->msg(99999); + // } + } + #######################################################################action####################################################################### #######################################################################action####################################################################### #######################################################################action####################################################################### + + public function get_user_msg_action($data){ + // 获取账号下信息以及用户信息 + $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->field('id,token,nickname,head_pic,tel,email')->find(); + if(!$user_data){ + return $this->msg(10003); + } + // $return_data = []; + // 获取账号下信息以及用户信息start + $user_all_data['aud_id'] = ''; + $user_all_data['token'] = $user_data['token']; + $user_all_data['nickname'] = $user_data['nickname']; + $user_all_data['head_pic'] = $user_data['head_pic']; + $user_all_data['gender'] = ''; + $user_all_data['age'] = ''; + $user_all_data['height'] = ''; + $user_all_data['weight'] = ''; + $user_all_data['set_kcal'] = ''; + $user_all_data['is_use_set_kcal'] = ''; + $user_all_data['tel'] = $user_data['tel']; + $user_all_data['email'] = $user_data['email']; + $cfc = Db::connect('cfc_db'); + $user_account = $cfc->table($this->kitchenscale_db_msg['user']) + ->where(["token"=>$data['token']]) + ->field('id as aud_id,token,nickname,head_pic,gender,age,height,weight,set_kcal,is_use_set_kcal') + ->find(); + if($user_account){ + if($user_account['set_kcal'] == '.00'){ + $user_account['set_kcal'] = 0; + } + $user_all_data['aud_id'] = $user_account['aud_id']; + $user_all_data['gender'] = $user_account['gender']; + $user_all_data['age'] = $user_account['age']; + $user_all_data['height'] = $user_account['height']; + $user_all_data['weight'] = $user_account['weight']; + $user_all_data['set_kcal'] = $user_account['set_kcal']; + $user_all_data['is_use_set_kcal'] = $user_account['is_use_set_kcal']; + }else{ + return $this->msg(10004); + } + + + // $return_data = $user_all_data; + return $this->msg($user_all_data); + // 获取账号下信息以及用户信息end + } + public function update_user_msg_action($data){ + if($data['gender'] == 0){ + return $this->msg(10005,'性别信息错误'); + } + // 获取账号下信息以及用户信息 + $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->count(); + if($user_data<=0){ + return $this->msg(10005,'账号信息错误'); + } + + $cfc = Db::connect('cfc_db'); + + $is_user_true = $cfc->table($this->kitchenscale_db_msg['user'])->where(['token'=>$data['token']])->count(); + + $user_msg['nickname'] = $data['nickname']; + $user_msg['head_pic'] = $data['gender'] == 1?'https://tc.pcxbc.com/tsf/1.png':'https://tc.pcxbc.com/tsf/2.png'; + $user_msg['gender'] = $data['gender']; + $user_msg['age'] = $data['age']; + $user_msg['height'] = $data['height']; + $user_msg['weight'] = $data['weight']; + + // $cfc->startTrans(); + // Db::startTrans(); + // try { + // if($is_user_true>0){ + // $user_msg['update_time'] = date('Y-m-d H:i:s'); + // $result = $cfc->table($this->kitchenscale_db_msg['user']) + // ->where(['token'=>$data['token']]) + // ->update($user_msg); + // }else{ + // $user_msg['token'] = $data['token']; + // $result = $cfc->table($this->kitchenscale_db_msg['user']) + // ->insert($user_msg); + // } + // Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->update(['nickname'=>$user_msg['nickname']]); + // // 提交事务 + // $cfc->commit(); + // Db::commit(); + // return $this->msg([]); + // } catch (\Exception $e) { + // // 回滚事务 + // $cfc->rollback(); + // Db::rollback(); + // return $this->msg(10002); + // } + + + + if($is_user_true>0){ + $user_msg['update_time'] = date('Y-m-d H:i:s'); + $result = $cfc->table($this->kitchenscale_db_msg['user']) + ->where(['token'=>$data['token']]) + ->update($user_msg); + }else{ + $user_msg['token'] = $data['token']; + $result = $cfc->table($this->kitchenscale_db_msg['user']) + ->insert($user_msg); + } + Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->update(['nickname'=>$user_msg['nickname']]); + if($result){ + return $this->msg([]); + }else{ + return $this->msg(10002); + } + } public function get_user_collect_list_action($data){ // 获取账号下信息以及用户信息 $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->count(); if($user_data<=0){ return $this->msg(10005,'账号信息错误'); } - $search_sql_str = "a.token = '".$data['token']."' AND a.is_del = 0"; + + $search_sql_str = "a.token = '".$data['token']."' AND a.is_del = 0 AND b.is_del = 0"; if(!array_key_exists('search_data', $data)){ $data['search_data'] = ""; }else{ @@ -146,6 +390,11 @@ class Usercenter extends Base{ ->field("b.id,b.title,b.cover as cover_id,c.pic_url as cover_url,b.likes_num,b.create_user_token,b.create_user_head_pic,b.create_user_nickname") ->page($data['page'],$this->page_num) ->select(); + + foreach ($collect_list as $key => $value) { + $collect_list[$key]['is_me_like_it'] = 'yes'; + + } return $this->msg([ 'page_now'=>$data['page'], @@ -160,26 +409,99 @@ class Usercenter extends Base{ if($user_data<=0){ return $this->msg(10005,'账号信息错误'); } + + $search_sql_str = "b.create_user_token = '".$data['token']."' AND b.is_del = 0"; + if(!array_key_exists('search_data', $data)){ + $data['search_data'] = ""; + }else{ + if($data['search_data'] === ""){ + $data['search_data'] = ""; + }else{ + $data['search_data'] = " AND (b.title LIKE '%".$data['search_data']."%' OR b.describe_data LIKE '%".$data['search_data']."%')"; + } + } + $search_sql_str = $search_sql_str.$data['search_data']; + $cfc = Db::connect('cfc_db'); $content_num = $cfc->table($this->kitchenscale_db_msg['cookbook']) ->alias('b') ->join($this->kitchenscale_db_msg['uploadimg'].' c','b.cover = c.id','LEFT') - ->where(['b.create_user_token'=>$data['token'],'b.is_del'=>0]) + ->where($search_sql_str) ->count(); $page_total = ceil($content_num/$this->page_num);; - $collect_list = $cfc->table($this->kitchenscale_db_msg['cookbook']) + $content_list = $cfc->table($this->kitchenscale_db_msg['cookbook']) ->alias('b') ->join($this->kitchenscale_db_msg['uploadimg'].' c','b.cover = c.id','LEFT') - ->where(['b.create_user_token'=>$data['token'],'b.is_del'=>0]) + ->where($search_sql_str) ->field("b.id,b.title,b.cover as cover_id,c.pic_url as cover_url,b.likes_num,b.create_user_token,b.create_user_head_pic,b.create_user_nickname") ->page($data['page'],$this->page_num) ->select(); + + // 获取用户收藏列表 + $my_collect_list = $cfc->table($this->kitchenscale_db_msg['collect_list']) + ->where(['token'=>$data['token'],'is_del'=>0]) + ->column('cookbook_id'); + // dump($my_collect_list); + // 处理菜谱收藏信息 + foreach ($content_list as $key => $value) { + // if(in_array($value['id'],$my_collect_list)){ + if(array_key_exists($value['id'],$my_collect_list)){ + $content_list[$key]['is_me_like_it'] = 'yes'; + }else{ + $content_list[$key]['is_me_like_it'] = 'no'; + } + // if($value['cover'] == null){ + // $content_list[$key]['cover'] = 'https://tc.pcxbc.com/kitchenscale_all/diule.jpg'; + // } + unset($content_list[$key]['ROW_NUMBER']); + } + + // foreach ($collect_list as $key => $value) { + // $collect_list[$key]['is_me_like_it'] = 'yes'; + + // } return $this->msg([ 'page_now'=>$data['page'], 'page_total'=>$page_total, - 'content_list'=>$collect_list + 'content_list'=>$content_list ]); } + public function del_my_cookbook_action($data){ + // 获取账号下信息以及用户信息 + $user_data = Db::table($this->reedaw_db_msg['zhanghao'])->where(['token'=>$data['token']])->count(); + if($user_data<=0){ + return $this->msg(10005,'账号信息错误'); + } + + $cfc = Db::connect('cfc_db'); + + $cookbook_data = $cfc->table($this->kitchenscale_db_msg['cookbook'])->where(['id'=>$data['cookbook_id'],'create_user_token'=>$data['token']])->find(); + + if($cookbook_data){ + + // 启动事务 + $cfc->startTrans(); + try{ + $cfc->table($this->kitchenscale_db_msg['cookbook'])->where(['id'=>$data['cookbook_id']])->update(['is_del'=>1]); + $result_banner = $cfc->table($this->kitchenscale_db_msg['banner'])->where(['cookbook_id'=>$cookbook_data['id']])->count(); + if($result_banner > 0){ + $cfc->table($this->kitchenscale_db_msg['banner'])->where(['cookbook_id'=>$cookbook_data['id']])->update(['is_del'=>1]); + } + // 提交事务 + $cfc->commit(); + return $this->msg([]); + } catch (\Exception $e) { + // 回滚事务 + $cfc->rollback(); + return $this->msg(10002); + } + }else{ + return $this->msg(10003); + } + + } + + } \ No newline at end of file diff --git a/application/KitchenScale/controller/app/Wechat.php b/application/KitchenScale/controller/app/Wechat.php new file mode 100644 index 0000000..c5ca3b5 --- /dev/null +++ b/application/KitchenScale/controller/app/Wechat.php @@ -0,0 +1,123 @@ +getSessionKey($code); + + if (empty($sessionData['openid']) || empty($sessionData['session_key'])) { + // throw new Exception('获取openid或session_key失败'); + // return false; + // return $this->msg(10001); + return ['code'=>10002,'msg'=>'获取openid或session_key失败']; + } + + // 2. 解密用户信息 + $userInfo = $this->decryptData($encryptedData, $iv, $sessionData['session_key']); + + if(array_key_exists('phoneNumber',$userInfo)){ + return ['code'=>0,'msg'=>'seccess','data'=>$userInfo]; + }else{ + return ['code'=>10002,'msg'=>'解密用户信息失败']; + } + // if (empty($userInfo['phoneNumber'])) { + // // throw new Exception('获取手机号失败'); + + // }else{ + + // } + + // // 3. 保存或更新用户信息 + // $user = User::where('openid', $sessionData['openid'])->find(); + // if (!$user) { + // $user = new User(); + // $user->openid = $sessionData['openid']; + // } + // $user->phone = $userInfo['phoneNumber']; + // $user->save(); + + // 返回成功信息 + // return ['code' => 0, 'msg' => '登录成功', 'data' => $user]; + // } catch (Exception $e) { + // // 返回错误信息 + // return ['code' => 500, 'msg' => $e->getMessage()]; + // } + } + /** + * 通过code获取openid和session_key + * + * @param string $code + * @return array + * @throws Exception + */ + private function getSessionKey($code) + { + $url = "https://api.weixin.qq.com/sns/jscode2session?appid={$this->app_id}&secret={$this->app_secret}&js_code={$code}&grant_type=authorization_code"; + $result = file_get_contents($url); + $data = json_decode($result, true); + + if (isset($data['openid']) && isset($data['session_key'])) { + return $data; + } else { + return ['code'=>10002,'msg'=>'获取openid或session_key失败']; + } + } + + /** + * 解密用户信息 + * + * @param string $encryptedData + * @param string $iv + * @param string $sessionKey + * @return array + * @throws Exception + */ + private function decryptData($encryptedData, $iv, $sessionKey) + { + // require_once 'wx_crypt/WXBizDataCrypt.php'; // 引入微信解密类 + // require_once env('root_path') . 'extend/wx_crypt/WXBizDataCrypt.php'; + // dump(ROOT_PATH . 'extend\wx_crypt\wxBizDataCrypt.php'); + require_once ROOT_PATH . 'extend\wx_crypt\wxBizDataCrypt.php'; + + $pc = new \WXBizDataCrypt($this->app_id, $sessionKey); + $errCode = $pc->decryptData($encryptedData, $iv, $data); + + if ($errCode == 0) { + return json_decode($data, true); + } else { + return ['code'=>10002,'msg'=>'解密用户信息失败('.$errCode.')']; + // throw new Exception('解密失败: ' . $errCode); + } + } + + + // 注册 + + + +} \ No newline at end of file diff --git a/application/admin/controller/Appversion.php b/application/admin/controller/Appversion.php index adbf5c6..bacad9b 100644 --- a/application/admin/controller/Appversion.php +++ b/application/admin/controller/Appversion.php @@ -40,7 +40,7 @@ class Appversion extends Base{ // } } $num = Db::table('app_version_log')->where($parameter)->count(); - $result = Db::table('app_version_log')->where($parameter)->order('is_del,id desc')->page($page,$this->page_num)->select(); + $result = Db::table('app_version_log')->where($parameter)->order('id desc')->page($page,$this->page_num)->select(); if(!$pd){ $return_data['num'] = $num; $return_data['data'] = $result; diff --git a/application/admin/controller/Kitchenscale.php b/application/admin/controller/Kitchenscale.php new file mode 100644 index 0000000..4f23559 --- /dev/null +++ b/application/admin/controller/Kitchenscale.php @@ -0,0 +1,62 @@ +'app_user_cookbook',//菜谱表 + 'cookbook_label'=>'app_user_cookbook_label',//菜谱标签表 + 'uploadimg'=>'app_user_upload_img',//素材表 + 'followlist'=>'app_user_follow_list',//关注列表 + 'collect_list'=>'app_user_collect_list',//收藏列表 + 'foodlist1'=>'app_food_type_one',//食材列表3 + 'foodlist2'=>'app_food_type_two',//食材列表3 + 'foodlist3'=>'app_food_type_three',//食材列表3 + 'user_kcal_log'=>'app_user_kcal_log',//食材列表3 + 'user'=>'app_user_data',//banner + ]; + ################################################################食材管理################################################################ + ################################################################食材管理################################################################ + ################################################################食材管理################################################################ + + public function food_ingredients_index_1($page = 1){ + $data = input(); + $pd = true; + $parameter = []; + if(array_key_exists('tt', $data)){ + $page = $data['page_num']; + unset($data['page_num']); + unset($data['tt']); + $pd = false; + } + $cfc = Db::connect('cfc_db'); + $num = $cfc->table($this->kitchenscale_db_msg['foodlist1'])->count(); + $result = $cfc->table($this->kitchenscale_db_msg['foodlist1'])->order('is_del,id')->select(); + if(!$pd){ + $result['num'] = $num; + $result['data'] = $result; + return $this->msg(0,'success',$result); + } + $this->assign([ + 'result' => $result, + 'num' => $num, + ]); + return $this->fetch(); + } + + + + ################################################################other################################################################ + ################################################################other################################################################ + ################################################################other################################################################ + + + +} \ No newline at end of file diff --git a/application/admin/view/index/index.html b/application/admin/view/index/index.html index d48cfcb..5130825 100644 --- a/application/admin/view/index/index.html +++ b/application/admin/view/index/index.html @@ -159,6 +159,42 @@ +
  • + + + 厨房秤 + + + +
  • + + + +
    +
    +
    +
    + + +
    + + +
    + +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    + + + + + \ No newline at end of file diff --git a/application/admin/view/kitchenscale/card_edit.html b/application/admin/view/kitchenscale/card_edit.html new file mode 100644 index 0000000..d448a5c --- /dev/null +++ b/application/admin/view/kitchenscale/card_edit.html @@ -0,0 +1,232 @@ + + + + + + app版本管理 + + + + + + + + + + + + +
    +
    +
    +
    + + +
    + + +
    + +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/application/admin/view/kitchenscale/food_ingredients_index_1.html b/application/admin/view/kitchenscale/food_ingredients_index_1.html new file mode 100644 index 0000000..5ce0e33 --- /dev/null +++ b/application/admin/view/kitchenscale/food_ingredients_index_1.html @@ -0,0 +1,251 @@ + + + + + 所有卡片管理 + + + + + + + + + + +
    + + 首页 + 演示 + + 导航元素 + + + +
    +
    +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + {volist name="result" id="vo"} + + + + + + + + + {/volist} + +
    ID类别类目名称创建时间状态操作
    {$vo.id}一级{$vo.name}{$vo.create_time} + {if condition="$vo.is_del == 1"} + 已停用 + {else /} + 已启用 + {/if} + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/application/admin/view/kitchenscale/food_ingredients_index_2.html b/application/admin/view/kitchenscale/food_ingredients_index_2.html new file mode 100644 index 0000000..5ce0e33 --- /dev/null +++ b/application/admin/view/kitchenscale/food_ingredients_index_2.html @@ -0,0 +1,251 @@ + + + + + 所有卡片管理 + + + + + + + + + + +
    + + 首页 + 演示 + + 导航元素 + + + +
    +
    +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + {volist name="result" id="vo"} + + + + + + + + + {/volist} + +
    ID类别类目名称创建时间状态操作
    {$vo.id}一级{$vo.name}{$vo.create_time} + {if condition="$vo.is_del == 1"} + 已停用 + {else /} + 已启用 + {/if} + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/application/admin/view/kitchenscale/food_ingredients_index_3.html b/application/admin/view/kitchenscale/food_ingredients_index_3.html new file mode 100644 index 0000000..5ce0e33 --- /dev/null +++ b/application/admin/view/kitchenscale/food_ingredients_index_3.html @@ -0,0 +1,251 @@ + + + + + 所有卡片管理 + + + + + + + + + + +
    + + 首页 + 演示 + + 导航元素 + + + +
    +
    +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + {volist name="result" id="vo"} + + + + + + + + + {/volist} + +
    ID类别类目名称创建时间状态操作
    {$vo.id}一级{$vo.name}{$vo.create_time} + {if condition="$vo.is_del == 1"} + 已停用 + {else /} + 已启用 + {/if} + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/application/app/controller/Login.php b/application/app/controller/Login.php index 417008d..8f3dc38 100644 --- a/application/app/controller/Login.php +++ b/application/app/controller/Login.php @@ -5,6 +5,7 @@ namespace app\app\controller; use think\Db; use PHPMailer\PHPMailer\PHPMailer; +use app\app\controller\Wechat;// 引入Wechat服务类 class Login extends Base{ @@ -90,6 +91,7 @@ class Login extends Base{ $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + $logContent['all_content'] .= "方法: (register_action)" . "\n"; $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; $this->record_api_log($data, $logContent, null); @@ -154,6 +156,7 @@ class Login extends Base{ $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + $logContent['all_content'] .= "方法: (reset_password)" . "\n"; $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; $this->record_api_log($data, $logContent, null); @@ -161,7 +164,6 @@ class Login extends Base{ } } - // 登录 public function login_action($data = ['data'=>'18530934717','validate_data'=>'0932','type'=>'login','validate_type'=>'password']){ try { @@ -238,6 +240,7 @@ class Login extends Base{ $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + $logContent['all_content'] .= "方法: (login_action)" . "\n"; $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; $this->record_api_log($data, $logContent, null); @@ -245,6 +248,82 @@ class Login extends Base{ } + } + // 微信手机号快捷登录 + public function wechat_quick_login(){ + try { + // 你的业务逻辑 + if(count(input('post.')) > 0){ + $data = input('post.'); + } + if(!array_key_exists('code', $data)){ + // return $this->msg(10001,''); + return $this->msg(10001,'code is miss'); + } + if(!array_key_exists('encryptedData', $data)){ + return $this->msg(10001,'encryptedData is miss'); + } + if(!array_key_exists('iv', $data)){ + return $this->msg(10001,'iv is miss'); + } + // 校验参数 + if (empty($data['code'])) { + return $this->msg(10001,'code is miss.'); + } + if (empty($data['encryptedData'])) { + return $this->msg(10001,'encryptedData is miss.'); + } + if (empty($data['iv'])) { + return $this->msg(10001,'iv is miss.'); + } + + // 调用Wechat服务类处理微信登录逻辑 + $wechatService = new Wechat(); + $result = $wechatService->handleWechatLogin($data['code'], $data['encryptedData'], $data['iv']); + + // die; + if($result['code'] == 0){ + // return $this->msg($result['code'],$result['msg']); + + $user_data = Db::table($this->login_use_db_name['1'])->where(['tel'=>$result['data']['phoneNumber'],'is_del'=>0])->find(); + + if($user_data){ + Db::table($this->login_use_db_name['1'])->where(['token'=>$user_data['token']])->update(['login_time'=>date('Y-m-d H:i:s')]); + $return_data = $this->msg(['token'=>$user_data['token'],'aan_id'=>$user_data['id']]); + }else{ + $set_data['password'] = ''; + $set_data['tel'] = $result['data']['phoneNumber']; + $set_data['head_pic'] = $this->default_head_pic; + $set_data['nickname'] = '用户'.$result['data']['phoneNumber']; + $set_data['create_time'] = date('Y-m-d H:i:s'); + $set_data['login_time'] = date('Y-m-d H:i:s'); + $set_data['token'] = md5($result['data']['phoneNumber'].$this->create_random_string(12).time()); + $set_user_result = Db::table($this->login_use_db_name['1'])->insertGetId($set_data); + if($set_user_result){ + $return_data = $this->msg(['token'=>$set_data['token'],'aan_id'=>$set_user_result],'登录成功'); + }else{ + $return_data = $this->msg(10002); + } + } + return $return_data; + }else{ + return $this->msg($result['code'],$result['msg']); + } + + } catch (\Exception $e) { + // 捕获异常 + $logContent["flie"] = $e->getFile(); + $logContent["line"] = $e->getLine(); + $logContent['all_content'] = "异常信息:\n"; + $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; + $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; + $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + $logContent['all_content'] .= "方法: (wechat_quick_login)" . "\n"; + $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; + $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; + $this->record_api_log($data, $logContent, null); + return $this->msg(99999); + } } // 退出登录操作 public function user_quit_account($data=['token'=>'0dafb98a10995c98b5a33b7d59d986ca']){ @@ -266,8 +345,6 @@ class Login extends Base{ }else{ $return_data = $this->msg(10002); } - - // 成功 $this->record_api_log($data, null, $return_data); return $return_data; @@ -279,6 +356,7 @@ class Login extends Base{ $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + $logContent['all_content'] .= "方法: (user_quit_account)" . "\n"; $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; $this->record_api_log($data, $logContent, null); @@ -286,8 +364,6 @@ class Login extends Base{ } } - - // 删除账号 public function delete_account($data=['token'=>'0dafb98a10995c98b5a33b7d59d986ca']){ try { @@ -316,6 +392,7 @@ class Login extends Base{ $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n"; $logContent['all_content'] .= "代码: " . $e->getCode() . "\n"; $logContent['all_content'] .= "文件: " . $e->getFile() . "\n"; + $logContent['all_content'] .= "方法: (delete_account)" . "\n"; $logContent['all_content'] .= "行号: " . $e->getLine() . "\n"; $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n"; $this->record_api_log($data, $logContent, null); @@ -336,7 +413,7 @@ class Login extends Base{ * $type(验证类型,是注册用,还是其他用途) 字符串 默认register(注册)(register、login、reset_password) * $road(是手机还是邮箱还是其他) 字符串 默认tel或email */ - public function send_phone_email_code($data = ['data'=>'18530934717']){ + public function send_phone_email_code($data = ['data'=>'18736019909']){ if(count(input('post.')) > 0){ $data = input('post.'); @@ -352,6 +429,7 @@ class Login extends Base{ $num = mt_rand(100000,999999); if (preg_match('/^\d{11}$/', $data['data'])) { $result = $this->send_tel_code($data['data'],$num); + // return $this->msg($result); $road = 'tel'; }else{ $result = $this->send_email_code([$data['data']],['title'=>'体测APP验证码','from_user_name'=>'体测APP','content'=>$num]); @@ -390,7 +468,12 @@ class Login extends Base{ $postData = array( 'phone' => $tel, // 'content' => '您好,欢迎使用Reedaw,您的手机验证码是:'.$code.',验证码三分钟内有效,若非本人操作,请忽略!' - 'content' => '【Reedaw】您好,欢迎使用Reedaw,您的验证码是:'.$code.',验证码一分钟内有效,若非本人操作,请忽略本短信' + // 'content' => '【Reedaw】您好,欢迎使用Reedaw,您的验证码是:'.$code.',验证码一分钟内有效,若非本人操作,请忽略本短信' + 'content' => '【巨天】您好,欢迎使用Reedaw,您的手机验证码是:'.$code.',验证码一分钟内有效,若非本人操作,请忽略本短信' + // 'content' => '【小白秤】您好,欢迎使用Reedaw,您的手机验证码是:'.$code.',验证码一分钟内有效,若非本人操作,请忽略本短信' + // 'content' => '【品传科技】您好,欢迎使用Reedaw,您的手机验证码是:'.$code.',验证码一分钟内有效,若非本人操作,请忽略本短信' + // 'content' => '【巨天】您好,欢迎使用巨天,您的手机验证码是:'.$code.',验证码一分钟内有效,若非本人操作,请忽略!' + ); $postData = json_encode($postData); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); diff --git a/application/app/controller/Msginformation.php b/application/app/controller/Msginformation.php index 5ceff76..9139895 100644 --- a/application/app/controller/Msginformation.php +++ b/application/app/controller/Msginformation.php @@ -7,6 +7,9 @@ use think\Db; class Msginformation extends Base{ + + protected $judge_wechat_release = false; + protected $msginformation_use_db_name = [ '1'=>'admin_editor_text_content', '2'=>'admin_editor_text_like_up_log', @@ -251,6 +254,9 @@ class Msginformation extends Base{ ################################################################业务################################################################ ################################################################get_sector_label_msg public function get_sector_label_msg_action($data){ + + + $Template_arr = [ 1=>[ 'id'=>'1', @@ -266,6 +272,17 @@ class Msginformation extends Base{ ] ], ]; + if($this->judge_wechat_release === true){ + $Template_arr = [ + 1=>[ + 'id'=>'1', + 'name'=>'推荐', + 'loop_data'=>[], + 'list'=>[ + ] + ], + ]; + } // 获取需要版块id start $sector = Db::query(" SELECT @@ -316,7 +333,9 @@ class Msginformation extends Base{ 'page_num'=>$this->page_num, 'content_data'=>[] ]; - // return $this->msg($return_result); + if($this->judge_wechat_release === true){ + return $this->msg($return_result); + } if($data['type'] != 0){ $type_str = " AND type LIKE '%".$data['type']."%'"; }else{ @@ -497,7 +516,18 @@ class Msginformation extends Base{ return $this->msg($return_data); } - + + + ################################################################小工具################################################################ + ################################################################小工具################################################################ + ################################################################小工具################################################################ + ################################################################小工具################################################################ + ################################################################小工具################################################################ + + // 判断微信发版工具 + public function judge_wechat_release(){ + + } } \ No newline at end of file diff --git a/application/app/controller/Myinformation.php b/application/app/controller/Myinformation.php index 990de72..69c9574 100644 --- a/application/app/controller/Myinformation.php +++ b/application/app/controller/Myinformation.php @@ -20,7 +20,7 @@ class Myinformation extends Base{ ################################################################接口################################################################ // 获取账号下信息 - public function get_my_account_msg($data = ['token'=>'0dafb98a10995c98b5a33b7d59d986ca']){ + public function get_my_account_msg($data = ['token'=>'e0966788d02cc93290d9d674921d9715']){ try { // 你的业务逻辑 if(count(input('post.')) > 0){ diff --git a/application/app/controller/Wechat.php b/application/app/controller/Wechat.php new file mode 100644 index 0000000..53d19e4 --- /dev/null +++ b/application/app/controller/Wechat.php @@ -0,0 +1,124 @@ +getSessionKey($code); + + if (empty($sessionData['openid']) || empty($sessionData['session_key'])) { + // throw new Exception('获取openid或session_key失败'); + // return false; + // return $this->msg(10001); + return ['code'=>10002,'msg'=>'获取openid或session_key失败']; + } + + // 2. 解密用户信息 + $userInfo = $this->decryptData($encryptedData, $iv, $sessionData['session_key']); + + if(array_key_exists('phoneNumber',$userInfo)){ + return ['code'=>0,'msg'=>'seccess','data'=>$userInfo]; + }else{ + return ['code'=>10002,'msg'=>'解密用户信息失败']; + } + // if (empty($userInfo['phoneNumber'])) { + // // throw new Exception('获取手机号失败'); + + // }else{ + + // } + + // // 3. 保存或更新用户信息 + // $user = User::where('openid', $sessionData['openid'])->find(); + // if (!$user) { + // $user = new User(); + // $user->openid = $sessionData['openid']; + // } + // $user->phone = $userInfo['phoneNumber']; + // $user->save(); + + // 返回成功信息 + // return ['code' => 0, 'msg' => '登录成功', 'data' => $user]; + // } catch (Exception $e) { + // // 返回错误信息 + // return ['code' => 500, 'msg' => $e->getMessage()]; + // } + } + /** + * 通过code获取openid和session_key + * + * @param string $code + * @return array + * @throws Exception + */ + private function getSessionKey($code) + { + $url = "https://api.weixin.qq.com/sns/jscode2session?appid={$this->app_id}&secret={$this->app_secret}&js_code={$code}&grant_type=authorization_code"; + $result = file_get_contents($url); + $data = json_decode($result, true); + + if (isset($data['openid']) && isset($data['session_key'])) { + return $data; + } else { + return ['code'=>10002,'msg'=>'获取openid或session_key失败']; + } + } + + /** + * 解密用户信息 + * + * @param string $encryptedData + * @param string $iv + * @param string $sessionKey + * @return array + * @throws Exception + */ + private function decryptData($encryptedData, $iv, $sessionKey) + { + // require_once 'wx_crypt/WXBizDataCrypt.php'; // 引入微信解密类 + // require_once env('root_path') . 'extend/wx_crypt/WXBizDataCrypt.php'; + // dump(ROOT_PATH . 'extend\wx_crypt\wxBizDataCrypt.php'); + require_once ROOT_PATH . 'extend\wx_crypt\wxBizDataCrypt.php'; + + $pc = new \WXBizDataCrypt($this->app_id, $sessionKey); + $errCode = $pc->decryptData($encryptedData, $iv, $data); + + if ($errCode == 0) { + return json_decode($data, true); + } else { + return ['code'=>10002,'msg'=>'解密用户信息失败('.$errCode.')']; + // throw new Exception('解密失败: ' . $errCode); + } + } + + + // 注册 + + + +} \ No newline at end of file diff --git a/application/code/controller/Qrcode.php b/application/code/controller/Qrcode.php index 33d2bca..704dc34 100644 --- a/application/code/controller/Qrcode.php +++ b/application/code/controller/Qrcode.php @@ -32,5 +32,357 @@ class Qrcode extends Base{ ]); return $this->fetch(); } + + + ##################################################################小贴士视频部分start################################################################## + ##################################################################小贴士视频部分start################################################################## + ##################################################################小贴士视频部分start################################################################## + // 小贴士的前端二维码页面 + public function little_tips_project(){ + $qrcode_db = Db::connect('qrcode_db'); + // $temporary_data = $qrcode_db->table('little_tips_data')->where(['is_del'=>0])->order('id desc')->select(); + // $temporary_data = $qrcode_db->table('little_tips_data')->where(['is_del'=>0])->order('id desc')->select(); + $temporary_data2 = $qrcode_db->table('little_tips_label')->where(['type'=>1])->order('is_del,id')->select(); + $title = $qrcode_db->table('little_tips_label')->where(['id'=>3])->find(); + // dump($temporary_data); + // dump($temporary_data2); + // dump($title); + // die; + $this->assign([ + 'label' => $temporary_data2, + 'title' => $title, + 'default_id' => $temporary_data2[0]['id'], + ]); + return $this->fetch(); + } + // 小贴士前端页面获取数据 + public function little_tips_get_video_list(){ + $data = input(); + $qrcode_db = Db::connect('qrcode_db'); + $temporary_data = $qrcode_db->table('little_tips_data')->where(['device_category'=>$data['id'],'is_del'=>0])->order('id desc')->select(); + return $this->msg($temporary_data); + } + + + + // 小贴士视频上传管理页面 + public function little_tips_project_set_page(){ + $qrcode_db = Db::connect('qrcode_db'); + $temporary_data = $qrcode_db->table('little_tips_data') + ->alias('a') + ->join('little_tips_label b','a.device_category = b.id','LEFT') + ->field('a.*,b.type_name') + ->order('is_del,id desc') + ->select(); + $temporary_data2 = $qrcode_db->table('little_tips_label')->where(['type'=>1])->order('is_del,id desc')->select(); + $title = $qrcode_db->table('little_tips_label')->where(['id'=>3])->find(); + + $this->assign([ + 'data' => $temporary_data, + 'label' => $temporary_data2, + 'title' => $title, + ]); + return $this->fetch(); + } + public function little_tips_project_upload_action(){ + // return $this->msg([]); + $temporary_data = []; + $qrcode_db = Db::connect('qrcode_db'); + + + $device_model = request()->param('device_model_name'); + $device_model_type = request()->param('device_model_type'); + $device_describe = request()->param('device_describe'); + $device_category = request()->param('device_category'); + $image_type = request()->param('image_type'); + $video_type = request()->param('video_type'); + if(!$device_model){ + return $this->msg(10001,'设备名称不能为空'); + } + + $temporary_data = []; + $temporary_data['device_model'] = $device_model; + if($device_describe){ + $temporary_data['device_describe'] = $device_describe; + } + if($device_model_type){ + $temporary_data['device_type'] = $device_model_type; + } + if($device_category){ + $temporary_data['device_category'] = $device_category; + } + // dump($image_type); + // dump($video_type); + + if($image_type == 'yes'){ + $pic = request()->file('image'); + $name_pic = $pic->getInfo()['name']; + $pathinfo_pic = pathinfo($name_pic); + $extension_pic = strtolower($pathinfo_pic['extension']); // 转换为小写以进行不区分大小写的比较 + $new_filename_pic = 'pic_'.time().$this->generateRandomString(). '.' . $extension_pic; + $info_pic = $pic->validate(['size'=>10*1024*1024,'ext'=>'jpg,png,gif'])->move(ROOT_PATH . 'public' . DS . 'teaching_video',$new_filename_pic); + if(!$info_pic){ + // 上传失败获取错误信息 + return $this->msg(10010,$pic->getError()); + } + $temporary_data['pic_url'] = "https://tc.pcxbc.com/teaching_video/".$new_filename_pic; + $temporary_data['pic_name'] = $new_filename_pic; + } + + if($video_type == 'yes'){ + $video = request()->file('video'); + $name_video = $video->getInfo()['name']; + $pathinfo_video = pathinfo($name_video); + $extension_video = strtolower($pathinfo_video['extension']); // 转换为小写以进行不区分大小写的比较 + $new_filename_video = 'pic_'.time().$this->generateRandomString(). '.' . $extension_video; + $info_video = $video->validate(['size'=>90*1024*1024,'ext'=>'mp4,avi,mkv,wmv'])->move(ROOT_PATH . 'public' . DS . 'teaching_video',$new_filename_video); + if(!$info_video){ + // 上传失败获取错误信息 + unlink(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $new_filename_pic); + return $this->msg(10011,$video->getError()); + } + $temporary_data['video_url'] = "https://tc.pcxbc.com/teaching_video/".$new_filename_video; + $temporary_data['video_name'] = $new_filename_video; + } + + // dump($temporary_data); + // die; + // 判断是修改还是新建 + $device_data = $qrcode_db->table('little_tips_data')->where(['device_model'=>$temporary_data['device_model']])->find(); + if($device_data){ + // 修改 + // unset($temporary_data['create_time']); + $result = $qrcode_db->table('little_tips_data') + ->where(['device_model'=>$temporary_data['device_model']]) + ->update($temporary_data); + // 删除刚才存储的图片和视频文件 + if($image_type == 'yes'){ + if($device_data['pic_name']){ + if (file_exists(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $device_data['pic_name'])) { + unlink(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $device_data['pic_name']); + } + } + } + if($video_type == 'yes'){ + if($device_data['video_name']){ + if (file_exists(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $device_data['video_name'])) { + unlink(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $device_data['video_name']); + } + } + } + + }else{ + $temporary_data['create_time'] = date('Y-m-d H:i:s'); + $result = $qrcode_db->table('little_tips_data')->insertGetId($temporary_data); + } + + if($result){ + return $this->msg([]); + }else{ + return $this->msg(10002,'操作失败'); + } + + + + + + + + + + + // // dump($device_model); + // // dump($device_model_type); + // // dump($device_describe); + // // dump($device_category); + // // die; + // if(!$device_model){ + // return $this->msg(10001,'设备名称不能为空'); + // } + + // dump($device_model); + // dump($devicdevice_model_typee_model); + // dump($device_category); + // dump($device_describe); + // dump($pic); + // dump($video); + // die; + // // if(!$device_model_type){ + // // return $this->msg(10001,'设备类型不能为空'); + // // } + // // if(!$device_category){ + // // return $this->msg(10001,'设备设备分类不能为空'); + // // } + // if(!$pic || !$video){ + + // return $this->msg(10001,'未选择图片或者视频'); + // }else{ + // // $name_pic = $pic->getInfo()['name']; + // // $pathinfo_pic = pathinfo($name_pic); + // // $extension_pic = strtolower($pathinfo_pic['extension']); // 转换为小写以进行不区分大小写的比较 + // // $new_filename_pic = 'pic_'.time().$this->generateRandomString(). '.' . $extension_pic; + + // // $name_video = $video->getInfo()['name']; + // // $pathinfo_video = pathinfo($name_video); + // // $extension_video = strtolower($pathinfo_video['extension']); // 转换为小写以进行不区分大小写的比较 + // // $new_filename_video = 'pic_'.time().$this->generateRandomString(). '.' . $extension_video; + + // // $info_pic = $pic->validate(['size'=>10*1024*1024,'ext'=>'jpg,png,gif'])->move(ROOT_PATH . 'public' . DS . 'teaching_video',$new_filename_pic); + // // if(!$info_pic){ + // // // 上传失败获取错误信息 + // // return $this->msg(10010,$pic->getError()); + // // } + // // $info_video = $video->validate(['size'=>90*1024*1024,'ext'=>'mp4,avi,mkv,wmv'])->move(ROOT_PATH . 'public' . DS . 'teaching_video',$new_filename_video); + // // if(!$info_video){ + // // // 上传失败获取错误信息 + // // unlink(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $new_filename_pic); + // // return $this->msg(10011,$video->getError()); + // // } + + + // $temporary_data = [ + // 'device_model'=>$device_model, + // 'device_describe'=>$device_describe, + // 'device_type'=>$device_model_type, + // 'device_category'=>$device_category, + // 'pic_url'=>"https://tc.pcxbc.com/teaching_video/".$new_filename_pic, + // 'video_url'=>"https://tc.pcxbc.com/teaching_video/".$new_filename_video, + // 'pic_name'=>$new_filename_pic, + // 'video_name'=>$new_filename_video, + // 'create_time'=>date('Y-m-d H:i:s'), + // ]; + + // if($device_data){ + // unset($temporary_data['create_time']); + // $result = $qrcode_db->table('little_tips_data') + // ->where(['device_model'=>$temporary_data['device_model']]) + // ->update($temporary_data); + // // 删除刚才存储的图片和视频文件 + // if (file_exists(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $device_data['pic_name'])) { + // unlink(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $device_data['pic_name']); + // } + // if (file_exists(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $device_data['video_name'])) { + // unlink(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $device_data['video_name']); + // } + // return $this->msg([]); + // }else{ + // $result = $qrcode_db->table('little_tips_data')->insertGetId($temporary_data); + // } + // if($result){ + // return $this->msg([]); + // }else{ + // return $this->msg(10002,'添加失败'); + // } + + // } + } + // 小贴士下架操作 + public function little_tips_is_del_update(){ + $data = input(); + $qrcode_db = Db::connect('qrcode_db'); + if(!array_key_exists('id', $data)){ + return $this->msg(10001,'id缺失'); + } + if(!array_key_exists('type', $data)){ + return $this->msg(10001,'type缺失'); + } + + $device_data = $qrcode_db->table('little_tips_data')->where(['id'=>$data['id']])->field('pic_name,video_name')->find(); + if($device_data){ + $temporary_data = $qrcode_db->table('little_tips_data')->where(['id'=>$data['id']])->update(['is_del'=>$data['type']]); + if($temporary_data){ + return $this->msg([]); + }else{ + return $this->msg(10002,'操作失败'); + } + }else{ + return $this->msg(10002,'未找到对应设备信息'); + } + } + // 小贴士删除操作 + public function little_tips_del_action(){ + $data = input(); + $qrcode_db = Db::connect('qrcode_db'); + if(!array_key_exists('id', $data)){ + return $this->msg(10001,'id缺失'); + } + + $device_data = $qrcode_db->table('little_tips_data')->where(['id'=>$data['id']])->field('pic_name,video_name')->find(); + $temporary_data = $qrcode_db->table('little_tips_data')->where(['id'=>$data['id']])->delete(); + unlink(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $device_data['pic_name']); + unlink(ROOT_PATH . 'public' . DS . 'teaching_video' . DS . $device_data['video_name']); + if($temporary_data){ + return $this->msg([]); + }else{ + return $this->msg(10002,'操作失败'); + } + } + ##################################################################小贴士视频部分end################################################################## + ##################################################################小贴士视频部分end################################################################## + ##################################################################小贴士视频部分end################################################################## + + public function add_label_action(){ + $data = input(); + $qrcode_db = Db::connect('qrcode_db'); + if(!array_key_exists('label', $data)){ + return $this->msg(10001,'label缺失'); + } + $device_data = $qrcode_db->table('little_tips_label')->insert([ + 'type_name'=>$data['label'], + 'create_time'=>date('Y-m-d H:i:s'), + 'type'=>1, + ]); + + if($device_data){ + return $this->msg([]); + }else{ + return $this->msg(10002,'操作失败'); + } + } + + public function update_title_action(){ + $data = input(); + $qrcode_db = Db::connect('qrcode_db'); + if(!array_key_exists('title', $data)){ + return $this->msg(10001,'title缺失'); + } + + $device_data = $qrcode_db->table('little_tips_label')->where(['id'=>3])->update([ + 'type_name'=>$data['title'], + ]); + + if($device_data){ + return $this->msg([]); + }else{ + return $this->msg(10002,'操作失败'); + } + } + + + + + + + + + + + + + + + ##################################################################以下是工具部分################################################################## + ##################################################################以下是工具部分################################################################## + ##################################################################以下是工具部分################################################################## + + public function generateRandomString($length = 10) { + $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; + $charactersLength = strlen($characters); + $randomString = ''; + for ($i = 0; $i < $length; $i++) { + $randomString .= $characters[rand(0, $charactersLength - 1)]; + } + return $randomString; + } } \ No newline at end of file diff --git a/application/code/view/qrcode/little_tips_project.html b/application/code/view/qrcode/little_tips_project.html new file mode 100644 index 0000000..654d2d3 --- /dev/null +++ b/application/code/view/qrcode/little_tips_project.html @@ -0,0 +1,382 @@ + + + + + + + + + + + + + + + 小贴士 + + + + + +
    +
    {$title.type_name}
    +
    + {volist name="label" id="vo"} + {$vo.type_name} + {/volist} +
    +
    +
    + +
    +
    +
    关闭
    +
    +
    + +
    +
    加载中...
    +
    + +
    +
    + + + + + diff --git a/application/code/view/qrcode/little_tips_project_set_page.html b/application/code/view/qrcode/little_tips_project_set_page.html new file mode 100644 index 0000000..e992539 --- /dev/null +++ b/application/code/view/qrcode/little_tips_project_set_page.html @@ -0,0 +1,608 @@ + + + + + + + + + + + + + + + 小贴士 + + + + +
    +
    小贴士管理页面
    +
    +
    +
    +
    设备型号:必填

    +
    设备类型:

    +
    设备描述:

    + +
    设备图片:请不要上传超过10M的图片

    +
    图片预览:

    +
    设备视频:请不要上传超过90M的视频,大于90M的视频概率会导致提交失败

    +
    视频名称:

    +
    + 设备分类: + + 必选 +
    +
    + +
    + 如果提交后,查询到已经有该设备型号,那么将更新该设备信息,没有则新建 +
    +
    +
    添加设备分类:必填(添加后将出现在上面黄色板块内的设备分类当中)

    + +
    +
    +
    页面标题:必填(修改后,前端展示页面的标题将更改)

    + 当前标题为“{$title.type_name}”
    + + +
    +
    +
    + 注:
    + 1、下架代表该设备及视频暂时下架,将不在列表内展示,后续如果恢复,可以点击上架重新展示
    + 2、删除则代表该设备及相关视频永久删除。不存在信息恢复可能。
    + 3、如信息编辑错误,则需要删除后重新编辑添加
    + 4、左侧的三个编辑板块之间并不关联,每个板块仅处理自己板块内的内容
    + + + + + + + + + + + + {volist name="data" id="vo"} + + + + + + + + + {if condition="$vo.is_del == 0"} + + {else /} + + {/if} + + {/volist} +
    设备名称设备类型设备描述所属分类设备图视频操作
    {$vo.device_model}{$vo.device_type}{$vo.device_describe}{$vo.type_name} + + + + + +
    + +
    +
    +
    +
    +
    关闭
    +
    +
    + + +
    请求发送中...请不要关闭页面或者刷新页面,等待上传完成
    +
    + 上传中... +
    +
    +
    +
    + + + + + diff --git a/application/config.php b/application/config.php index 62019bb..9488540 100644 --- a/application/config.php +++ b/application/config.php @@ -242,7 +242,7 @@ return [ ], - // 第二个数据库配置(厨房秤) + // 第2个数据库配置(厨房秤) 'cfc_db' => [ // 数据库类型 'type' => 'sqlsrv', @@ -266,4 +266,28 @@ return [ // 数据库调试模式 'debug' => true, ], + // 第3个数据库配置(二维码) + 'qrcode_db' => [ + // 数据库类型 + 'type' => 'sqlsrv', + // 服务器地址 + 'hostname' => '121.36.67.254', + // 'hostname' => '127.0.0.1', + // 数据库名 + 'database' => 'all_qrcode_data', + // 用户名 + 'username' => 'jt_user', + // 密码 + 'password' => 'jtuser1qaz@WSX', + // 端口 + 'hostport' => '4331', + // 数据库连接参数 + 'params' => [], + // 数据库编码默认采用utf8 + 'charset' => 'utf8', + // 数据库表前缀 + 'prefix' => '', + // 数据库调试模式 + 'debug' => true, + ], ]; diff --git a/application/route.php b/application/route.php index 167003d..ab34ef0 100644 --- a/application/route.php +++ b/application/route.php @@ -34,6 +34,22 @@ Route::any('/business_cooperation_action', 'app/download/business_cooperation_ac Route::any('/ordinary_code', 'code/qrcode/ordinary_code'); // 配合reedaw&宠物小白使用 Route::any('/bluetooth_code', 'code/qrcode/bluetooth_code'); +// 配合小贴士使用 +Route::any('/little_tips_project', 'code/qrcode/little_tips_project'); +Route::any('/little_tips_get_video_list', 'code/qrcode/little_tips_get_video_list'); + +Route::any('/little_tips_project_set_page', 'code/qrcode/little_tips_project_set_page'); +Route::any('/little_tips_project_upload_action', 'code/qrcode/little_tips_project_upload_action'); +Route::any('/little_tips_is_del_update', 'code/qrcode/little_tips_is_del_update'); +Route::any('/little_tips_del_action', 'code/qrcode/little_tips_del_action'); +Route::any('/add_label_action', 'code/qrcode/add_label_action'); +Route::any('/update_title_action', 'code/qrcode/update_title_action'); + + + + + + // // ################################################################设备请求入口################################################################ // // ################################################################设备请求入口################################################################ @@ -64,6 +80,7 @@ Route::any('/admin/pic', 'admin/base/pic_index'); Route::any('/admin/pic_upload_action', 'admin/base/pic_upload_action'); + // 登录页 Route::any('/admin/login', 'admin/login/login'); // 登录动作 @@ -156,6 +173,20 @@ Route::any('/technology/set_user_opinion', 'admin/technology/set_user_opinion'); // // Route::get('/admin/member_list', 'admin/member/member_list'); // // Route::get('/admin/user_list', 'admin/member/user_list'); +// ################################################################厨房秤部分################################### +// #################################食材管理 +// 一级食材页面 +Route::any('/kitchenscale/food_ingredients_index_1', 'admin/kitchenscale/food_ingredients_index_1'); +// 二级食材页面 +Route::any('/kitchenscale/food_ingredients_index_2', 'admin/kitchenscale/food_ingredients_index_2'); +// 三级食材页面 +Route::any('/kitchenscale/food_ingredients_index_3', 'admin/kitchenscale/food_ingredients_index_3'); +// 菜谱管理 +Route::any('/technology/index', 'admin/technology/index'); +Route::any('/technology/web_index', 'admin/technology/web_index'); +Route::any('/technology/privacy_index', 'admin/technology/privacy_index'); +Route::any('/technology/set_user_opinion', 'admin/technology/set_user_opinion'); + // // ################################################################APP接口################################################################ @@ -191,6 +222,9 @@ Route::any('/testedition/reset_password', 'testapp/login/reset_password'); // 登录接口 Route::any('/login_action', 'app/login/login_action'); Route::any('/testedition/login_action', 'testapp/login/login_action'); +// 微信小程序快捷登录接口 +Route::any('/wechat_quick_login', 'app/login/wechat_quick_login'); +Route::any('/testedition/wechat_quick_login', 'testapp/login/wechat_quick_login'); // 手机或者邮箱验证码接口接口 Route::any('/send_phone_email_code', 'app/login/send_phone_email_code'); Route::any('/testedition/send_phone_email_code', 'testapp/login/send_phone_email_code'); @@ -406,11 +440,18 @@ Route::any('/open_wechat_content', 'app/Msginformation/open_wechat_content'); ################################################################下面是厨房秤################################################################ ########################################################################################################################################### +// 微信小程序快捷登录接口 +Route::any('/kitchenscale/wechat_quick_login', 'app/kitchenscale/app.index/wechat_quick_login'); +Route::any('/testedition/kitchenscale/wechat_quick_login', 'app/kitchenscale/app.index/wechat_quick_login'); + // 公共内容################################################################ // 获取用户上传图片列表 Route::any('/kitchenscale/pic_chose_list', 'app/kitchenscale/app.base/pic_chose_list'); Route::any('/testedition/kitchenscale/pic_chose_list', 'app/kitchenscale/testapp.base/pic_chose_list'); // 用户多图上传接口 +Route::any('/kitchenscale/pic_upload_one_action', 'app/kitchenscale/app.base/pic_upload_one_action'); +Route::any('/testedition/kitchenscale/pic_upload_one_action', 'app/kitchenscale/testapp.base/pic_upload_one_action'); +// 用户多图上传接口 Route::any('/kitchenscale/pic_upload_action', 'app/kitchenscale/app.base/pic_upload_action'); Route::any('/testedition/kitchenscale/pic_upload_action', 'app/kitchenscale/testapp.base/pic_upload_action'); @@ -436,6 +477,10 @@ Route::any('/testedition/kitchenscale/search_column', 'app/kitchenscale/testapp. // 添加菜谱 Route::any('/kitchenscale/add_cookbook', 'app/kitchenscale/app.cookbook/add_cookbook'); Route::any('/testedition/kitchenscale/add_cookbook', 'app/kitchenscale/testapp.cookbook/add_cookbook'); +// 修改菜谱 +Route::any('/kitchenscale/update_cookbook', 'app/kitchenscale/app.cookbook/update_cookbook'); +Route::any('/testedition/kitchenscale/update_cookbook', 'app/kitchenscale/testapp.cookbook/update_cookbook'); + // 根据菜谱标签查询列表(首页用) Route::any('/kitchenscale/find_by_cook_label', 'app/kitchenscale/app.cookbook/find_by_cook_label'); Route::any('/testedition/kitchenscale/find_by_cook_label', 'app/kitchenscale/testapp.cookbook/find_by_cook_label'); @@ -468,17 +513,42 @@ Route::any('/testedition/kitchenscale/get_cookbook_label_list', 'app/kitchenscal // 计食器################################################################ -// 保存每日餐食食物信息 -Route::any('/kitchenscale/save_food_list', 'app/kitchenscale/app.cookbook/save_food_list'); -Route::any('/testedition/kitchenscale/save_food_list', 'app/kitchenscale/testapp.cookbook/save_food_list'); +// 添加每日摄入记录 +Route::any('/kitchenscale/add_intake_food', 'app/kitchenscale/app.countfood/add_intake_food'); +Route::any('/testedition/kitchenscale/add_intake_food', 'app/kitchenscale/testapp.countfood/add_intake_food'); +// 获取记食器板块内容 +Route::any('/kitchenscale/get_countfoot_content', 'app/kitchenscale/app.countfood/get_countfoot_content'); +Route::any('/testedition/kitchenscale/get_countfoot_content', 'app/kitchenscale/testapp.countfood/get_countfoot_content'); +// 获取记食器记录 +Route::any('/kitchenscale/get_log_list', 'app/kitchenscale/app.countfood/get_log_list'); +Route::any('/testedition/kitchenscale/get_log_list', 'app/kitchenscale/testapp.countfood/get_log_list'); +// 计食器板块-设置内容 +Route::any('/kitchenscale/set_up_content', 'app/kitchenscale/app.countfood/set_up_content'); +Route::any('/testedition/kitchenscale/set_up_content', 'app/kitchenscale/testapp.countfood/set_up_content'); +// 设置用户的卡路里 +Route::any('/kitchenscale/set_user_kcal', 'app/kitchenscale/app.countfood/set_user_kcal'); +Route::any('/testedition/kitchenscale/set_user_kcal', 'app/kitchenscale/testapp.countfood/set_user_kcal'); + // 我的################################################################ + + +// 获取角色信息 +Route::any('/kitchenscale/get_user_msg', 'app/kitchenscale/app.usercenter/get_user_msg'); +Route::any('/testedition/kitchenscale/get_user_msg', 'app/kitchenscale/testapp.usercenter/get_user_msg'); +// 修改角色信息 +Route::any('/kitchenscale/update_user_msg', 'app/kitchenscale/app.usercenter/update_user_msg'); +Route::any('/testedition/kitchenscale/update_user_msg', 'app/kitchenscale/testapp.usercenter/update_user_msg'); // 账号收藏点赞列表 Route::any('/kitchenscale/get_user_collect_list', 'app/kitchenscale/app.usercenter/get_user_collect_list'); Route::any('/testedition/kitchenscale/get_user_collect_list', 'app/kitchenscale/testapp.usercenter/get_user_collect_list'); // 我的菜谱 Route::any('/kitchenscale/get_my_cookbook', 'app/kitchenscale/app.usercenter/get_my_cookbook'); Route::any('/testedition/kitchenscale/get_my_cookbook', 'app/kitchenscale/testapp.usercenter/get_my_cookbook'); +// 菜谱删除 +Route::any('/kitchenscale/del_my_cookbook', 'app/kitchenscale/app.usercenter/del_my_cookbook'); +Route::any('/testedition/kitchenscale/del_my_cookbook', 'app/kitchenscale/testapp.usercenter/del_my_cookbook'); + // 测试用内容################################################################ @@ -504,6 +574,9 @@ Route::any('/testedition/del_all_read_log', 'testapp/Msginformation/del_all_read Route::any('/ceshiyong', 'app/base/ceshiyong'); Route::any('/testedition/ceshiyong', 'testapp/base/ceshiyong'); +Route::any('/kitchenscale/chuli_shuju', 'app/kitchenscale/app.cookbook/chuli_shuju'); + + // Route::any('/app_update_file/*', 'app/sportstesting/aaaaaaaaaaaaaaa'); // 处理404错误 z diff --git a/composer.json b/composer.json index a77d17e..bfa9603 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "php": ">=5.4.0", "topthink/framework": "5.0.*", "phpmailer/phpmailer": "^6.9", - "phpoffice/phpspreadsheet": "^1.25" + "phpoffice/phpspreadsheet": "^1.25", + "overtrue/wechat": "~4.0" }, "autoload": { "psr-4": { @@ -32,7 +33,11 @@ "config": { "preferred-install": "dist", "allow-plugins": { - "topthink/think-installer": true + "topthink/think-installer": true, + "easywechat-composer/easywechat-composer": true + }, + "audit": { + "enabled": false } } } diff --git a/public/kitchenscale_all/privacy_index.html b/public/kitchenscale_all/privacy_index.html new file mode 100644 index 0000000..4dfffa9 --- /dev/null +++ b/public/kitchenscale_all/privacy_index.html @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + 隐私协议 + + + + +
    +
    轻厨记隐私协议
    +
    +
    一、前言
    +
    感谢您选择使用我们的智能厨房秤APP(以下简称“本应用”)。我们深知您的个人信息安全至关重要,在您使用本应用时,我们郑重承诺将严格遵守相关法律法规,采取合理有效的措施保护您的个人隐私。本隐私协议旨在明确我们在采集、使用、存储、共享及保护您的个人信息方面的责任和义务。请您在使用本应用前,仔细阅读并理解本协议内容。一旦您开始使用本应用,即视为您同意我们按照本协议的规定处理您的个人信息。
    +
    二、信息收集
    +
    1.必要信息:为了提供基本服务,我们可能会收集您的手机号码、电子邮箱等联系方式,以便验证身份、保障账号安全及提供必要的服务支持。
    +
    2.健康数据:在使用本应用时,您可以选择提供身高、体重、BMI等健康数据,以便我们为您计算营养摄入建议或生成健康报告。
    +
    3.饮食记录:本应用会记录您通过厨房秤测量的食材重量、饮食内容及时间等信息,用于分析您的饮食习惯并提供个性化建议。
    +
    4.设备信息:为了优化服务体验,我们可能会采集您的设备型号、操作系统版本、IP地址等必要的技术信息。这些信息将帮助我们了解用户的使用环境,以便进行技术调试和服务改进。
    +
    三、信息使用
    +
    1.服务提供:我们将根据您提供的信息,为您提供食材称重、营养分析、饮食记录及健康建议等服务。
    +
    2.个性化推荐:基于您的饮食记录、健康数据和使用习惯,我们可能会向您推荐适合的食谱、营养计划或健康管理方案。
    +
    3.数据分析:我们会对收集到的数据进行匿名化处理,用于统计分析、产品优化及服务改进。这些统计数据将不包含任何可以识别您个人身份的信息。
    +
    四、信息共享与披露
    +
    1.内部共享:我们可能会将您的信息共享给公司内部负责处理您个人信息的部门或人员,以确保为您提供更好的服务。
    +
    2.第三方合作:在必要且合法的情况下,我们可能会与第三方服务提供商(如云服务提供商、数据分析公司等)共享您的个人信息,以便他们为我们提供技术支持或数据分析服务。我们将与这些第三方签订严格的保密协议,并要求其遵守相关法律法规和本协议的规定。
    +
    3.法律要求:在法律法规要求或政府部门、司法机关依法要求的情况下,我们可能会披露您的个人信息。
    +
    五、信息安全
    +
    1.技术保障:我们将采取合理的技术手段和管理措施,确保您的个人信息在采集、存储、使用及共享过程中的安全。
    +
    2.数据加密:对于敏感信息(如健康数据、饮食记录等),我们将采用加密技术进行处理,防止数据在传输和存储过程中被非法访问或泄露。
    +
    3.访问控制:我们将对访问个人信息的员工进行严格的权限管理,确保只有授权人员才能接触相关信息。
    +
    六、用户权利
    +
    1.知情权:您有权了解我们采集、使用、共享及保护您个人信息的详细情况。
    +
    2.选择权:您有权选择是否向我们提供个人信息的具体内容,以及是否接受个性化推荐服务。
    +
    3.更正权:如果您发现我们采集的个人信息有误,您有权要求我们及时更正。
    +
    4.删除权:在符合法律法规要求的情况下,您有权要求删除您的个人信息。
    +
    七、协议变更
    +
    我们有权根据法律法规的变化或业务发展的需要,对本隐私协议进行修订。修订后的协议将通过本应用内通知或其他适当方式告知您。请您定期查阅本协议,以便及时了解最新政策。
    +
    八、争议解决
    +
    如因本协议产生任何争议,双方应首先通过友好协商解决;协商不成的,任何一方均有权向本应用运营方所在地的人民法院提起诉讼。
    +
    九、生效与终止
    +
    本协议自您同意并接受之日起生效,并持续有效至您注销账号或本应用终止服务时止。
    +
    +
    + + + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 18e0a0b..016c54b 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -6,6 +6,11 @@ $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( + 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', + 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Stringable' => $vendorDir . '/myclabs/php-enum/stubs/Stringable.php', + 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 8fab624..48d254f 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -6,6 +6,13 @@ $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', '2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', + 'f0e7e63bbb278a92db02393536748c5f' => $vendorDir . '/overtrue/wechat/src/Kernel/Support/Helpers.php', + '6747f579ad6817f318cc3a7e7a0abb93' => $vendorDir . '/overtrue/wechat/src/Kernel/Helpers.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index e60f352..be11dd8 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -6,5 +6,6 @@ $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( + 'Pimple' => array($vendorDir . '/pimple/pimple/src'), 'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'), ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index fba4380..552138c 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -10,13 +10,34 @@ return array( 'think\\' => array($baseDir . '/thinkphp/library/think'), 'app\\' => array($baseDir . '/application'), 'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'), + 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), + 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), + 'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'), + 'Symfony\\Contracts\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher-contracts'), + 'Symfony\\Contracts\\Cache\\' => array($vendorDir . '/symfony/cache-contracts'), + 'Symfony\\Component\\VarExporter\\' => array($vendorDir . '/symfony/var-exporter'), + 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), + 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), + 'Symfony\\Component\\Cache\\' => array($vendorDir . '/symfony/cache'), + 'Symfony\\Bridge\\PsrHttpMessage\\' => array($vendorDir . '/symfony/psr-http-message-bridge'), 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), + 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), + 'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'), + 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), + 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), 'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), + 'Overtrue\\Socialite\\' => array($vendorDir . '/overtrue/socialite/src'), 'MyCLabs\\Enum\\' => array($vendorDir . '/myclabs/php-enum/src'), + 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), 'Matrix\\' => array($vendorDir . '/markbaker/matrix/classes/src'), + 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), + 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), + 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), + 'EasyWeChat\\' => array($vendorDir . '/overtrue/wechat/src'), + 'EasyWeChatComposer\\' => array($vendorDir . '/easywechat-composer/easywechat-composer/src'), 'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'), ); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 607f176..2e3f097 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -7,8 +7,15 @@ namespace Composer\Autoload; class ComposerStaticInit2bc4f313dba415539e266f7ac2c87dcd { public static $files = array ( + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', '2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', + 'f0e7e63bbb278a92db02393536748c5f' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Support/Helpers.php', + '6747f579ad6817f318cc3a7e7a0abb93' => __DIR__ . '/..' . '/overtrue/wechat/src/Kernel/Helpers.php', ); public static $prefixLengthsPsr4 = array ( @@ -27,21 +34,51 @@ class ComposerStaticInit2bc4f313dba415539e266f7ac2c87dcd ), 'S' => array ( + 'Symfony\\Polyfill\\Php80\\' => 23, + 'Symfony\\Polyfill\\Php73\\' => 23, 'Symfony\\Polyfill\\Mbstring\\' => 26, + 'Symfony\\Contracts\\Service\\' => 26, + 'Symfony\\Contracts\\EventDispatcher\\' => 34, + 'Symfony\\Contracts\\Cache\\' => 24, + 'Symfony\\Component\\VarExporter\\' => 30, + 'Symfony\\Component\\HttpFoundation\\' => 33, + 'Symfony\\Component\\EventDispatcher\\' => 34, + 'Symfony\\Component\\Cache\\' => 24, + 'Symfony\\Bridge\\PsrHttpMessage\\' => 30, ), 'P' => array ( 'Psr\\SimpleCache\\' => 16, + 'Psr\\Log\\' => 8, 'Psr\\Http\\Message\\' => 17, 'Psr\\Http\\Client\\' => 16, + 'Psr\\EventDispatcher\\' => 20, + 'Psr\\Container\\' => 14, + 'Psr\\Cache\\' => 10, 'PhpOffice\\PhpSpreadsheet\\' => 25, 'PHPMailer\\PHPMailer\\' => 20, ), + 'O' => + array ( + 'Overtrue\\Socialite\\' => 19, + ), 'M' => array ( 'MyCLabs\\Enum\\' => 13, + 'Monolog\\' => 8, 'Matrix\\' => 7, ), + 'G' => + array ( + 'GuzzleHttp\\Psr7\\' => 16, + 'GuzzleHttp\\Promise\\' => 19, + 'GuzzleHttp\\' => 11, + ), + 'E' => + array ( + 'EasyWeChat\\' => 11, + 'EasyWeChatComposer\\' => 19, + ), 'C' => array ( 'Complex\\' => 8, @@ -65,14 +102,58 @@ class ComposerStaticInit2bc4f313dba415539e266f7ac2c87dcd array ( 0 => __DIR__ . '/..' . '/maennchen/zipstream-php/src', ), + 'Symfony\\Polyfill\\Php80\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', + ), + 'Symfony\\Polyfill\\Php73\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', + ), 'Symfony\\Polyfill\\Mbstring\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', ), + 'Symfony\\Contracts\\Service\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/service-contracts', + ), + 'Symfony\\Contracts\\EventDispatcher\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/event-dispatcher-contracts', + ), + 'Symfony\\Contracts\\Cache\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/cache-contracts', + ), + 'Symfony\\Component\\VarExporter\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/var-exporter', + ), + 'Symfony\\Component\\HttpFoundation\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/http-foundation', + ), + 'Symfony\\Component\\EventDispatcher\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/event-dispatcher', + ), + 'Symfony\\Component\\Cache\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/cache', + ), + 'Symfony\\Bridge\\PsrHttpMessage\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/psr-http-message-bridge', + ), 'Psr\\SimpleCache\\' => array ( 0 => __DIR__ . '/..' . '/psr/simple-cache/src', ), + 'Psr\\Log\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', + ), 'Psr\\Http\\Message\\' => array ( 0 => __DIR__ . '/..' . '/psr/http-factory/src', @@ -82,6 +163,18 @@ class ComposerStaticInit2bc4f313dba415539e266f7ac2c87dcd array ( 0 => __DIR__ . '/..' . '/psr/http-client/src', ), + 'Psr\\EventDispatcher\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/event-dispatcher/src', + ), + 'Psr\\Container\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/container/src', + ), + 'Psr\\Cache\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/cache/src', + ), 'PhpOffice\\PhpSpreadsheet\\' => array ( 0 => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet', @@ -90,14 +183,42 @@ class ComposerStaticInit2bc4f313dba415539e266f7ac2c87dcd array ( 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', ), + 'Overtrue\\Socialite\\' => + array ( + 0 => __DIR__ . '/..' . '/overtrue/socialite/src', + ), 'MyCLabs\\Enum\\' => array ( 0 => __DIR__ . '/..' . '/myclabs/php-enum/src', ), + 'Monolog\\' => + array ( + 0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog', + ), 'Matrix\\' => array ( 0 => __DIR__ . '/..' . '/markbaker/matrix/classes/src', ), + 'GuzzleHttp\\Psr7\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', + ), + 'GuzzleHttp\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', + ), + 'GuzzleHttp\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', + ), + 'EasyWeChat\\' => + array ( + 0 => __DIR__ . '/..' . '/overtrue/wechat/src', + ), + 'EasyWeChatComposer\\' => + array ( + 0 => __DIR__ . '/..' . '/easywechat-composer/easywechat-composer/src', + ), 'Complex\\' => array ( 0 => __DIR__ . '/..' . '/markbaker/complex/classes/src', @@ -105,6 +226,13 @@ class ComposerStaticInit2bc4f313dba415539e266f7ac2c87dcd ); public static $prefixesPsr0 = array ( + 'P' => + array ( + 'Pimple' => + array ( + 0 => __DIR__ . '/..' . '/pimple/pimple/src', + ), + ), 'H' => array ( 'HTMLPurifier' => @@ -115,8 +243,13 @@ class ComposerStaticInit2bc4f313dba415539e266f7ac2c87dcd ); public static $classMap = array ( + 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', + 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Stringable' => __DIR__ . '/..' . '/myclabs/php-enum/stubs/Stringable.php', + 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 62fa0af..a70eac4 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,5 +1,56 @@ { "packages": [ + { + "name": "easywechat-composer/easywechat-composer", + "version": "1.4.1", + "version_normalized": "1.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/mingyoung/easywechat-composer.git", + "reference": "3fc6a7ab6d3853c0f4e2922539b56cc37ef361cd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mingyoung/easywechat-composer/zipball/3fc6a7ab6d3853c0f4e2922539b56cc37ef361cd", + "reference": "3fc6a7ab6d3853c0f4e2922539b56cc37ef361cd", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=7.0" + }, + "require-dev": { + "composer/composer": "^1.0 || ^2.0", + "phpunit/phpunit": "^6.5 || ^7.0" + }, + "time": "2021-07-05T04:03:22+00:00", + "type": "composer-plugin", + "extra": { + "class": "EasyWeChatComposer\\Plugin" + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "EasyWeChatComposer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "张铭阳", + "email": "mingyoungcheung@gmail.com" + } + ], + "description": "The composer plugin for EasyWeChat", + "support": { + "issues": "https://github.com/mingyoung/easywechat-composer/issues", + "source": "https://github.com/mingyoung/easywechat-composer/tree/1.4.1" + }, + "install-path": "../easywechat-composer/easywechat-composer" + }, { "name": "ezyang/htmlpurifier", "version": "v4.18.0", @@ -64,6 +115,340 @@ }, "install-path": "../ezyang/htmlpurifier" }, + { + "name": "guzzlehttp/guzzle", + "version": "7.9.2", + "version_normalized": "7.9.2.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "time": "2024-07-24T11:22:20+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.9.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/guzzle" + }, + { + "name": "guzzlehttp/promises", + "version": "2.0.4", + "version_normalized": "2.0.4.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "time": "2024-10-17T10:06:22+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/promises" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.7.0", + "version_normalized": "2.7.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "time": "2024-07-18T11:15:46+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.7.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/psr7" + }, { "name": "maennchen/zipstream-php", "version": "2.1.0", @@ -244,18 +629,123 @@ "install-path": "../markbaker/matrix" }, { - "name": "myclabs/php-enum", - "version": "1.8.4", - "version_normalized": "1.8.4.0", + "name": "monolog/monolog", + "version": "2.10.0", + "version_normalized": "2.10.0.0", "source": { "type": "git", - "url": "https://github.com/myclabs/php-enum.git", - "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483" + "url": "https://github.com/Seldaek/monolog.git", + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/php-enum/zipball/a867478eae49c9f59ece437ae7f9506bfaa27483", - "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7", + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2 || ^2@dev", + "guzzlehttp/guzzle": "^7.4", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "phpspec/prophecy": "^1.15", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5.38 || ^9.6.19", + "predis/predis": "^1.1 || ^2.0", + "rollbar/rollbar": "^1.3 || ^2 || ^3", + "ruflin/elastica": "^7", + "swiftmailer/swiftmailer": "^5.3|^6.0", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "time": "2024-11-12T12:43:37+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.10.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "install-path": "../monolog/monolog" + }, + { + "name": "myclabs/php-enum", + "version": "1.8.5", + "version_normalized": "1.8.5.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "e7be26966b7398204a234f8673fdad5ac6277802" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/e7be26966b7398204a234f8673fdad5ac6277802", + "reference": "e7be26966b7398204a234f8673fdad5ac6277802", "shasum": "" }, "require": { @@ -265,9 +755,9 @@ "require-dev": { "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "1.*", - "vimeo/psalm": "^4.6.2" + "vimeo/psalm": "^4.6.2 || ^5.2" }, - "time": "2022-08-04T09:53:51+00:00", + "time": "2025-01-14T11:49:03+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -289,10 +779,14 @@ } ], "description": "PHP Enum implementation", - "homepage": "http://github.com/myclabs/php-enum", + "homepage": "https://github.com/myclabs/php-enum", "keywords": [ "enum" ], + "support": { + "issues": "https://github.com/myclabs/php-enum/issues", + "source": "https://github.com/myclabs/php-enum/tree/1.8.5" + }, "funding": [ { "url": "https://github.com/mnapoli", @@ -305,6 +799,151 @@ ], "install-path": "../myclabs/php-enum" }, + { + "name": "overtrue/socialite", + "version": "2.0.24", + "version_normalized": "2.0.24.0", + "source": { + "type": "git", + "url": "https://github.com/overtrue/socialite.git", + "reference": "ee7e7b000ec7d64f2b8aba1f6a2eec5cdf3f8bec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/overtrue/socialite/zipball/ee7e7b000ec7d64f2b8aba1f6a2eec5cdf3f8bec", + "reference": "ee7e7b000ec7d64f2b8aba1f6a2eec5cdf3f8bec", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/guzzle": "^5.0|^6.0|^7.0", + "php": ">=5.6", + "symfony/http-foundation": "^2.7|^3.0|^4.0|^5.0" + }, + "require-dev": { + "mockery/mockery": "~1.2", + "phpunit/phpunit": "^6.0|^7.0|^8.0|^9.0" + }, + "time": "2021-05-13T16:04:48+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Overtrue\\Socialite\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "overtrue", + "email": "anzhengchao@gmail.com" + } + ], + "description": "A collection of OAuth 2 packages that extracts from laravel/socialite.", + "keywords": [ + "login", + "oauth", + "qq", + "social", + "wechat", + "weibo" + ], + "support": { + "issues": "https://github.com/overtrue/socialite/issues", + "source": "https://github.com/overtrue/socialite/tree/2.0.24" + }, + "funding": [ + { + "url": "https://www.patreon.com/overtrue", + "type": "patreon" + } + ], + "install-path": "../overtrue/socialite" + }, + { + "name": "overtrue/wechat", + "version": "4.9.0", + "version_normalized": "4.9.0.0", + "source": { + "type": "git", + "url": "https://github.com/w7corp/easywechat.git", + "reference": "92791f5d957269c633b9aa175f842f6006f945b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/w7corp/easywechat/zipball/92791f5d957269c633b9aa175f842f6006f945b1", + "reference": "92791f5d957269c633b9aa175f842f6006f945b1", + "shasum": "" + }, + "require": { + "easywechat-composer/easywechat-composer": "^1.1", + "ext-fileinfo": "*", + "ext-openssl": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.2 || ^7.0", + "monolog/monolog": "^1.22 || ^2.0", + "overtrue/socialite": "~2.0", + "php": ">=7.2", + "pimple/pimple": "^3.0", + "psr/simple-cache": "^1.0", + "symfony/cache": "^3.3 || ^4.3 || ^5.0", + "symfony/event-dispatcher": "^4.3 || ^5.0", + "symfony/http-foundation": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/psr-http-message-bridge": "^0.3 || ^1.0 || ^2.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.15", + "mikey179/vfsstream": "^1.6", + "mockery/mockery": "^1.2.3", + "phpstan/phpstan": "^0.12.0", + "phpunit/phpunit": "^7.5" + }, + "time": "2023-04-28T03:30:34+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "src/Kernel/Support/Helpers.php", + "src/Kernel/Helpers.php" + ], + "psr-4": { + "EasyWeChat\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "overtrue", + "email": "anzhengchao@gmail.com" + } + ], + "description": "微信SDK", + "keywords": [ + "easywechat", + "sdk", + "wechat", + "weixin", + "weixin-sdk" + ], + "support": { + "issues": "https://github.com/w7corp/easywechat/issues", + "source": "https://github.com/w7corp/easywechat/tree/4.9.0" + }, + "funding": [ + { + "url": "https://github.com/overtrue", + "type": "github" + } + ], + "abandoned": "w7corp/easywechat", + "install-path": "../overtrue/wechat" + }, { "name": "phpmailer/phpmailer", "version": "v6.9.3", @@ -493,6 +1132,223 @@ ], "install-path": "../phpoffice/phpspreadsheet" }, + { + "name": "pimple/pimple", + "version": "v3.5.0", + "version_normalized": "3.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a94b3a4db7fb774b3d78dad2315ddc07629e1bed", + "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1 || ^2.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^5.4@dev" + }, + "time": "2021-10-28T11:13:42+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Pimple": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Pimple, a simple Dependency Injection Container", + "homepage": "https://pimple.symfony.com", + "keywords": [ + "container", + "dependency injection" + ], + "support": { + "source": "https://github.com/silexphp/Pimple/tree/v3.5.0" + }, + "install-path": "../pimple/pimple" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2016-08-06T20:24:11+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "install-path": "../psr/cache" + }, + { + "name": "psr/container", + "version": "2.0.1", + "version_normalized": "2.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/2ae37329ee82f91efadc282cc2d527fd6065a5ef", + "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "time": "2021-03-24T13:40:57+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.1" + }, + "install-path": "../psr/container" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "time": "2019-01-08T18:20:26+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "install-path": "../psr/event-dispatcher" + }, { "name": "psr/http-client", "version": "1.0.3", @@ -653,6 +1509,59 @@ ], "install-path": "../psr/http-message" }, + { + "name": "psr/log", + "version": "1.1.4", + "version_normalized": "1.1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2021-05-03T11:20:27+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "install-path": "../psr/log" + }, { "name": "psr/simple-cache", "version": "1.0.1", @@ -704,6 +1613,554 @@ ], "install-path": "../psr/simple-cache" }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "version_normalized": "3.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "time": "2019-03-08T08:55:37+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "install-path": "../ralouphie/getallheaders" + }, + { + "name": "symfony/cache", + "version": "v5.4.46", + "version_normalized": "5.4.46.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "0fe08ee32cec2748fbfea10c52d3ee02049e0f6b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/0fe08ee32cec2748fbfea10c52d3ee02049e0f6b", + "reference": "0fe08ee32cec2748fbfea10c52d3ee02049e0f6b", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0", + "psr/log": "^1.1|^2|^3", + "symfony/cache-contracts": "^1.1.7|^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "conflict": { + "doctrine/dbal": "<2.13.1", + "symfony/dependency-injection": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/var-dumper": "<4.4" + }, + "provide": { + "psr/cache-implementation": "1.0|2.0", + "psr/simple-cache-implementation": "1.0|2.0", + "symfony/cache-implementation": "1.0|2.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/cache": "^1.6|^2.0", + "doctrine/dbal": "^2.13.1|^3|^4", + "predis/predis": "^1.1|^2.0", + "psr/simple-cache": "^1.0|^2.0", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "time": "2024-11-04T11:43:55+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "support": { + "source": "https://github.com/symfony/cache/tree/v5.4.46" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/cache" + }, + { + "name": "symfony/cache-contracts", + "version": "v2.5.4", + "version_normalized": "2.5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "517c3a3619dadfa6952c4651767fcadffb4df65e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/517c3a3619dadfa6952c4651767fcadffb4df65e", + "reference": "517c3a3619dadfa6952c4651767fcadffb4df65e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0|^3.0" + }, + "suggest": { + "symfony/cache-implementation": "" + }, + "time": "2024-09-25T14:11:13+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "2.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v2.5.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/cache-contracts" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.4", + "version_normalized": "2.5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2024-09-25T14:11:13+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "2.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/deprecation-contracts" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.4.45", + "version_normalized": "5.4.45.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/72982eb416f61003e9bb6e91f8b3213600dcf9e9", + "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "time": "2024-09-25T14:11:13+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.45" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/event-dispatcher" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v2.5.4", + "version_normalized": "2.5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f", + "reference": "e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "time": "2024-09-25T14:11:13+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "2.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/event-dispatcher-contracts" + }, + { + "name": "symfony/http-foundation", + "version": "v5.4.48", + "version_normalized": "5.4.48.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "3f38b8af283b830e1363acd79e5bc3412d055341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3f38b8af283b830e1363acd79e5bc3412d055341", + "reference": "3f38b8af283b830e1363acd79e5bc3412d055341", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "predis/predis": "^1.0|^2.0", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/rate-limiter": "^5.2|^6.0" + }, + "suggest": { + "symfony/mime": "To use the file extension guesser" + }, + "time": "2024-11-13T18:58:02+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v5.4.48" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/http-foundation" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.31.0", @@ -787,6 +2244,400 @@ ], "install-path": "../symfony/polyfill-mbstring" }, + { + "name": "symfony/polyfill-php73", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "time": "2024-09-09T11:45:10+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php73" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "time": "2024-09-09T11:45:10+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php80" + }, + { + "name": "symfony/psr-http-message-bridge", + "version": "v2.3.1", + "version_normalized": "2.3.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/psr-http-message-bridge.git", + "reference": "581ca6067eb62640de5ff08ee1ba6850a0ee472e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/581ca6067eb62640de5ff08ee1ba6850a0ee472e", + "reference": "581ca6067eb62640de5ff08ee1ba6850a0ee472e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/http-message": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/http-foundation": "^5.4 || ^6.0" + }, + "require-dev": { + "nyholm/psr7": "^1.1", + "psr/log": "^1.1 || ^2 || ^3", + "symfony/browser-kit": "^5.4 || ^6.0", + "symfony/config": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/framework-bundle": "^5.4 || ^6.0", + "symfony/http-kernel": "^5.4 || ^6.0", + "symfony/phpunit-bridge": "^6.2" + }, + "suggest": { + "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" + }, + "time": "2023-07-26T11:53:26+00:00", + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-main": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Bridge\\PsrHttpMessage\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "PSR HTTP message bridge", + "homepage": "http://symfony.com", + "keywords": [ + "http", + "http-message", + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/symfony/psr-http-message-bridge/issues", + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.3.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/psr-http-message-bridge" + }, + { + "name": "symfony/service-contracts", + "version": "v1.1.2", + "version_normalized": "1.1.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/191afdcb5804db960d26d8566b7e9a2843cab3a0", + "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "suggest": { + "psr/container": "", + "symfony/service-implementation": "" + }, + "time": "2019-05-28T07:50:59+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v1.1.2" + }, + "install-path": "../symfony/service-contracts" + }, + { + "name": "symfony/var-exporter", + "version": "v5.4.45", + "version_normalized": "5.4.45.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "862700068db0ddfd8c5b850671e029a90246ec75" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/862700068db0ddfd8c5b850671e029a90246ec75", + "reference": "862700068db0ddfd8c5b850671e029a90246ec75", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0" + }, + "time": "2024-09-25T14:11:13+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v5.4.45" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/var-exporter" + }, { "name": "topthink/framework", "version": "v5.0.25", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 0a01730..662d199 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,13 +3,22 @@ 'name' => 'topthink/think', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'fcd7859cf4ed7d92ea7f2b5250e35e824d6b0d57', + 'reference' => '96a7b429339e68a8dfd3eaa4457d6f8cfdf0e6d5', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( + 'easywechat-composer/easywechat-composer' => array( + 'pretty_version' => '1.4.1', + 'version' => '1.4.1.0', + 'reference' => '3fc6a7ab6d3853c0f4e2922539b56cc37ef361cd', + 'type' => 'composer-plugin', + 'install_path' => __DIR__ . '/../easywechat-composer/easywechat-composer', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'ezyang/htmlpurifier' => array( 'pretty_version' => 'v4.18.0', 'version' => '4.18.0.0', @@ -19,6 +28,33 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'guzzlehttp/guzzle' => array( + 'pretty_version' => '7.9.2', + 'version' => '7.9.2.0', + 'reference' => 'd281ed313b989f213357e3be1a179f02196ac99b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/promises' => array( + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', + 'reference' => 'f9c436286ab2892c7db7be8c8da4ef61ccf7b455', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/promises', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/psr7' => array( + 'pretty_version' => '2.7.0', + 'version' => '2.7.0.0', + 'reference' => 'a70f5c95fb43bc83f07c9c948baa0dc1829bf201', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/psr7', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'maennchen/zipstream-php' => array( 'pretty_version' => '2.1.0', 'version' => '2.1.0.0', @@ -46,15 +82,42 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'monolog/monolog' => array( + 'pretty_version' => '2.10.0', + 'version' => '2.10.0.0', + 'reference' => '5cf826f2991858b54d5c3809bee745560a1042a7', + 'type' => 'library', + 'install_path' => __DIR__ . '/../monolog/monolog', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'myclabs/php-enum' => array( - 'pretty_version' => '1.8.4', - 'version' => '1.8.4.0', - 'reference' => 'a867478eae49c9f59ece437ae7f9506bfaa27483', + 'pretty_version' => '1.8.5', + 'version' => '1.8.5.0', + 'reference' => 'e7be26966b7398204a234f8673fdad5ac6277802', 'type' => 'library', 'install_path' => __DIR__ . '/../myclabs/php-enum', 'aliases' => array(), 'dev_requirement' => false, ), + 'overtrue/socialite' => array( + 'pretty_version' => '2.0.24', + 'version' => '2.0.24.0', + 'reference' => 'ee7e7b000ec7d64f2b8aba1f6a2eec5cdf3f8bec', + 'type' => 'library', + 'install_path' => __DIR__ . '/../overtrue/socialite', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'overtrue/wechat' => array( + 'pretty_version' => '4.9.0', + 'version' => '4.9.0.0', + 'reference' => '92791f5d957269c633b9aa175f842f6006f945b1', + 'type' => 'library', + 'install_path' => __DIR__ . '/../overtrue/wechat', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'phpmailer/phpmailer' => array( 'pretty_version' => 'v6.9.3', 'version' => '6.9.3.0', @@ -73,6 +136,54 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'pimple/pimple' => array( + 'pretty_version' => 'v3.5.0', + 'version' => '3.5.0.0', + 'reference' => 'a94b3a4db7fb774b3d78dad2315ddc07629e1bed', + 'type' => 'library', + 'install_path' => __DIR__ . '/../pimple/pimple', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/cache' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/cache', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/cache-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0|2.0', + ), + ), + 'psr/container' => array( + 'pretty_version' => '2.0.1', + 'version' => '2.0.1.0', + 'reference' => '2ae37329ee82f91efadc282cc2d527fd6065a5ef', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/container', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/event-dispatcher' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/event-dispatcher', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/event-dispatcher-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), 'psr/http-client' => array( 'pretty_version' => '1.0.3', 'version' => '1.0.3.0', @@ -82,6 +193,12 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'psr/http-client-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), 'psr/http-factory' => array( 'pretty_version' => '1.1.0', 'version' => '1.1.0.0', @@ -91,6 +208,12 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'psr/http-factory-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), 'psr/http-message' => array( 'pretty_version' => '1.1', 'version' => '1.1.0.0', @@ -100,6 +223,27 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'psr/http-message-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/log' => array( + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/log', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/log-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0.0 || 2.0.0 || 3.0.0', + ), + ), 'psr/simple-cache' => array( 'pretty_version' => '1.0.1', 'version' => '1.0.1.0', @@ -109,6 +253,87 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'psr/simple-cache-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0|2.0', + ), + ), + 'ralouphie/getallheaders' => array( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ralouphie/getallheaders', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/cache' => array( + 'pretty_version' => 'v5.4.46', + 'version' => '5.4.46.0', + 'reference' => '0fe08ee32cec2748fbfea10c52d3ee02049e0f6b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/cache', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/cache-contracts' => array( + 'pretty_version' => 'v2.5.4', + 'version' => '2.5.4.0', + 'reference' => '517c3a3619dadfa6952c4651767fcadffb4df65e', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/cache-contracts', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/cache-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0|2.0', + ), + ), + 'symfony/deprecation-contracts' => array( + 'pretty_version' => 'v2.5.4', + 'version' => '2.5.4.0', + 'reference' => '605389f2a7e5625f273b53960dc46aeaf9c62918', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/event-dispatcher' => array( + 'pretty_version' => 'v5.4.45', + 'version' => '5.4.45.0', + 'reference' => '72982eb416f61003e9bb6e91f8b3213600dcf9e9', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/event-dispatcher', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/event-dispatcher-contracts' => array( + 'pretty_version' => 'v2.5.4', + 'version' => '2.5.4.0', + 'reference' => 'e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/event-dispatcher-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '2.0', + ), + ), + 'symfony/http-foundation' => array( + 'pretty_version' => 'v5.4.48', + 'version' => '5.4.48.0', + 'reference' => '3f38b8af283b830e1363acd79e5bc3412d055341', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/http-foundation', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'symfony/polyfill-mbstring' => array( 'pretty_version' => 'v1.31.0', 'version' => '1.31.0.0', @@ -118,6 +343,51 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'symfony/polyfill-php73' => array( + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '0f68c03565dcaaf25a890667542e8bd75fe7e5bb', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php73', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '60328e362d4c2c802a54fcbf04f9d3fb892b4cf8', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/psr-http-message-bridge' => array( + 'pretty_version' => 'v2.3.1', + 'version' => '2.3.1.0', + 'reference' => '581ca6067eb62640de5ff08ee1ba6850a0ee472e', + 'type' => 'symfony-bridge', + 'install_path' => __DIR__ . '/../symfony/psr-http-message-bridge', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/service-contracts' => array( + 'pretty_version' => 'v1.1.2', + 'version' => '1.1.2.0', + 'reference' => '191afdcb5804db960d26d8566b7e9a2843cab3a0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/service-contracts', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/var-exporter' => array( + 'pretty_version' => 'v5.4.45', + 'version' => '5.4.45.0', + 'reference' => '862700068db0ddfd8c5b850671e029a90246ec75', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/var-exporter', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'topthink/framework' => array( 'pretty_version' => 'v5.0.25', 'version' => '5.0.25.0', @@ -130,7 +400,7 @@ 'topthink/think' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'fcd7859cf4ed7d92ea7f2b5250e35e824d6b0d57', + 'reference' => '96a7b429339e68a8dfd3eaa4457d6f8cfdf0e6d5', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/vendor/myclabs/php-enum/README.md b/vendor/myclabs/php-enum/README.md index 681d55e..948f374 100644 --- a/vendor/myclabs/php-enum/README.md +++ b/vendor/myclabs/php-enum/README.md @@ -34,6 +34,8 @@ use MyCLabs\Enum\Enum; /** * Action enum + * + * @extends Enum */ final class Action extends Enum { diff --git a/vendor/myclabs/php-enum/composer.json b/vendor/myclabs/php-enum/composer.json index 978cb19..eab6263 100644 --- a/vendor/myclabs/php-enum/composer.json +++ b/vendor/myclabs/php-enum/composer.json @@ -3,7 +3,7 @@ "type": "library", "description": "PHP Enum implementation", "keywords": ["enum"], - "homepage": "http://github.com/myclabs/php-enum", + "homepage": "https://github.com/myclabs/php-enum", "license": "MIT", "authors": [ { @@ -31,6 +31,6 @@ "require-dev": { "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "1.*", - "vimeo/psalm": "^4.6.2" + "vimeo/psalm": "^4.6.2 || ^5.2" } } diff --git a/vendor/myclabs/php-enum/src/Enum.php b/vendor/myclabs/php-enum/src/Enum.php index 4c94cf6..1bd5592 100644 --- a/vendor/myclabs/php-enum/src/Enum.php +++ b/vendor/myclabs/php-enum/src/Enum.php @@ -176,6 +176,7 @@ abstract class Enum implements \JsonSerializable, \Stringable /** @psalm-var T $value */ foreach (static::toArray() as $key => $value) { + /** @psalm-suppress UnsafeGenericInstantiation */ $values[$key] = new static($value); } @@ -297,6 +298,7 @@ abstract class Enum implements \JsonSerializable, \Stringable $message = "No static method or enum constant '$name' in class " . static::class; throw new \BadMethodCallException($message); } + /** @psalm-suppress UnsafeGenericInstantiation */ return self::$instances[$class][$name] = new static($array[$name]); } return clone self::$instances[$class][$name]; @@ -308,7 +310,6 @@ abstract class Enum implements \JsonSerializable, \Stringable * * @return mixed * @link http://php.net/manual/en/jsonserializable.jsonserialize.php - * @psalm-pure */ #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/vendor/myclabs/php-enum/src/PHPUnit/Comparator.php b/vendor/myclabs/php-enum/src/PHPUnit/Comparator.php index 302bf80..7c65e4e 100644 --- a/vendor/myclabs/php-enum/src/PHPUnit/Comparator.php +++ b/vendor/myclabs/php-enum/src/PHPUnit/Comparator.php @@ -43,7 +43,7 @@ final class Comparator extends \SebastianBergmann\Comparator\Comparator ); } - private function formatEnum(Enum $enum = null) + private function formatEnum(?Enum $enum = null) { if ($enum === null) { return "null";