diff --git a/addon/article/model/Article.php b/addon/article/model/Article.php index c8697dcd..b7e79e11 100644 --- a/addon/article/model/Article.php +++ b/addon/article/model/Article.php @@ -25,7 +25,9 @@ class Article extends NewBaseModel{ protected $append = [ 'category_name' ]; - + protected $autoWriteTimestamp = 'int'; // 开启自动时间戳 + protected $createTime = 'create_time'; // 默认添加时间字段 + protected $updateTime = 'update_time'; // 默认编辑时间字段 /** * Common: 列表获取 diff --git a/addon/article/model/ArticleCategory.php b/addon/article/model/ArticleCategory.php index 02dd10ef..673fbab0 100644 --- a/addon/article/model/ArticleCategory.php +++ b/addon/article/model/ArticleCategory.php @@ -17,6 +17,9 @@ use app\model\NewBaseModel; class ArticleCategory extends NewBaseModel{ protected $pk = 'category_id'; + protected $autoWriteTimestamp = 'int'; // 开启自动时间戳 + protected $createTime = 'create_time'; // 默认添加时间字段 + protected $updateTime = 'update_time'; // 默认编辑时间字段 /** * Common: 列表获取 * Author: wu-hui diff --git a/addon/article/model/ArticleHistory.php b/addon/article/model/ArticleHistory.php index 7304f3c0..274a8545 100644 --- a/addon/article/model/ArticleHistory.php +++ b/addon/article/model/ArticleHistory.php @@ -18,6 +18,7 @@ class ArticleHistory extends NewBaseModel{ protected $pk = 'id'; //protected $autoWriteTimestamp = false; // 开启自动时间戳 + protected $autoWriteTimestamp = 'int'; // 开启自动时间戳 protected $createTime = 'create_time'; // 默认添加时间字段 protected $updateTime = 'update_time'; // 默认编辑时间字段 protected $deleteTime = false; // 软删除字段 diff --git a/addon/wechat/api/controller/Wechat.php b/addon/wechat/api/controller/Wechat.php index 7106c08f..253bb086 100644 --- a/addon/wechat/api/controller/Wechat.php +++ b/addon/wechat/api/controller/Wechat.php @@ -180,6 +180,6 @@ class Wechat extends BaseApi $config_model = new ConfigModel(); $config_result = $config_model->getWechatConfig($this->site_id)[ 'data' ][ 'value' ]; - return $this->response($this->success([ 'qrcode' => $config_result[ 'qrcode' ] ])); + return $this->response($this->success([ 'qrcode' => $config_result[ 'qrcode' ] ?? '' ])); } } \ No newline at end of file diff --git a/app/common.php b/app/common.php index d98bd22d..80729f5a 100644 --- a/app/common.php +++ b/app/common.php @@ -1829,4 +1829,73 @@ function decode($code) $num += strpos($sourceString, $code[$i]) * pow(4, $i); } return $num; +} + +/** + * Common: 下划线字符串 转 驼峰字符串 + * Author: wu-hui + * Time: 2022/10/20 16:25 + * @param $string + * @param string $separator + * @return string + */ +function camelize($string,$separator = '_'){ + $string = $separator. str_replace($separator, " ", strtolower($string)); + return ltrim(str_replace(" ", "", ucwords($string)), $separator ); +} +/** + * Common: 根据类型获取对应的时间戳 + * Author: wu-hui + * Time: 2022/11/01 17:20 + * @param $type + * @return array + */ +function getTimeStamp($type){ + $startTime = $endTime =0; + #year=本年,month=本月,today=今日,yesterday=昨日,last_week=上周, + switch($type){ + // 本年 + case "year": + $startTime = strtotime(date("Y-1-1")); + $endTime = strtotime(date("Y-1-1"). " +1 year -1 day "); + break; + // 本月 + case "month": + $startTime = strtotime(date("Y-m-1")); + $endTime = strtotime(date("Y-m-1"). " +1 month -1 day "); + break; + // 今日 + case "today": + $startTime = strtotime(date("Y-m-d")); + $endTime = strtotime(date("Y-m-d"). " +1 day "); + break; + // 昨日 + case "yesterday": + $startTime = strtotime(date("Y-m-d"). " -1 day "); + $endTime = strtotime(date("Y-m-d")); + break; + // 上周 + case "last_week": + $week = date('w') == 0 ? 7 : date('w'); + $startTime = strtotime('today -' . ($week - 1) . 'day -1 week'); + $endTime = strtotime('today +' . (8 - $week) . 'day -1 week'); + break; + + } + return [$startTime,$endTime]; +} +/** + * Common: 字符串脱敏处理 + * Author: wu-hui + * Time: 2022/11/03 10:48 + * @param string $str 字符串内容 + * @param int $front 前面保留数字字数 + * @param int $after 后面保留数字字数 + * @return string + */ +function desensitizationHandle($str,$front,$after){ + $frontStr = mb_substr($str,0,$front); + $afterStr = mb_substr($str,-$after,$after); + + return $frontStr.'***'.$afterStr; } \ No newline at end of file diff --git a/app/shop/controller/NewBaseShop.php b/app/shop/controller/NewBaseShop.php new file mode 100644 index 00000000..ead2f58a --- /dev/null +++ b/app/shop/controller/NewBaseShop.php @@ -0,0 +1,70 @@ +thisDefaultModel->getList($this->site_id); + } + /** + * Common: 公共内容 —— 添加/编辑信息 + * Author: wu-hui + * Time: 2022/10/18 14:09 + */ + public function editInfo(){ + if (request()->isAjax()) { + // 参数获取 + $info = input('info',[]); + $info['site_id'] = $this->site_id; + + return $this->thisDefaultModel->editInfo($info); + } else { + // 获取id + $id = input('id',0); + $this->assign('id',$id); + // 获取信息 + if($id > 0){ + $info = $this->thisDefaultModel->singleInfo($id); + $this->assign('info',$info['data'] ?? []); + }else{ + $this->assign('info',[]); + } + + } + } + /** + * Common: 删除单条信息 + * Author: wu-hui + * Time: 2022/10/18 14:13 + */ + public function delete(){ + $id = input('id', 0); + + return $this->thisDefaultModel->delInfo($id); + } + + + + +} \ No newline at end of file diff --git a/public/picture/aijiu/article_bg.jpg b/public/picture/aijiu/article_bg.jpg new file mode 100644 index 00000000..b1bf0535 Binary files /dev/null and b/public/picture/aijiu/article_bg.jpg differ diff --git a/public/picture/aijiu/customer_1.png b/public/picture/aijiu/customer_1.png new file mode 100644 index 00000000..592adacd Binary files /dev/null and b/public/picture/aijiu/customer_1.png differ diff --git a/public/picture/aijiu/customer_2.png b/public/picture/aijiu/customer_2.png new file mode 100644 index 00000000..83d102ca Binary files /dev/null and b/public/picture/aijiu/customer_2.png differ diff --git a/public/picture/aijiu/customer_3.png b/public/picture/aijiu/customer_3.png new file mode 100644 index 00000000..48e4e22c Binary files /dev/null and b/public/picture/aijiu/customer_3.png differ diff --git a/public/picture/aijiu/customer_not.png b/public/picture/aijiu/customer_not.png new file mode 100644 index 00000000..f09114fd Binary files /dev/null and b/public/picture/aijiu/customer_not.png differ diff --git a/public/picture/aijiu/dianzan.png b/public/picture/aijiu/dianzan.png new file mode 100644 index 00000000..4280aac5 Binary files /dev/null and b/public/picture/aijiu/dianzan.png differ diff --git a/public/picture/aijiu/distribution_extension_bg.jpg b/public/picture/aijiu/distribution_extension_bg.jpg new file mode 100644 index 00000000..a5605d0b Binary files /dev/null and b/public/picture/aijiu/distribution_extension_bg.jpg differ diff --git a/public/picture/aijiu/fenxiao.png b/public/picture/aijiu/fenxiao.png new file mode 100644 index 00000000..8276b6a2 Binary files /dev/null and b/public/picture/aijiu/fenxiao.png differ diff --git a/public/picture/aijiu/integral.png b/public/picture/aijiu/integral.png new file mode 100644 index 00000000..3d3559d5 Binary files /dev/null and b/public/picture/aijiu/integral.png differ diff --git a/public/picture/aijiu/liulan.png b/public/picture/aijiu/liulan.png new file mode 100644 index 00000000..6ae1ac4d Binary files /dev/null and b/public/picture/aijiu/liulan.png differ diff --git a/public/picture/aijiu/personal_center_vip_bg.png b/public/picture/aijiu/personal_center_vip_bg.png new file mode 100644 index 00000000..294a7766 Binary files /dev/null and b/public/picture/aijiu/personal_center_vip_bg.png differ diff --git a/public/picture/aijiu/ranking_1.png b/public/picture/aijiu/ranking_1.png new file mode 100644 index 00000000..96806765 Binary files /dev/null and b/public/picture/aijiu/ranking_1.png differ diff --git a/public/picture/aijiu/ranking_2.png b/public/picture/aijiu/ranking_2.png new file mode 100644 index 00000000..388a43d0 Binary files /dev/null and b/public/picture/aijiu/ranking_2.png differ diff --git a/public/picture/aijiu/ranking_3.png b/public/picture/aijiu/ranking_3.png new file mode 100644 index 00000000..0a688074 Binary files /dev/null and b/public/picture/aijiu/ranking_3.png differ diff --git a/public/picture/aijiu/ranking_title_bg.jpg b/public/picture/aijiu/ranking_title_bg.jpg new file mode 100644 index 00000000..eae00cba Binary files /dev/null and b/public/picture/aijiu/ranking_title_bg.jpg differ diff --git a/public/picture/aijiu/reward_box.png b/public/picture/aijiu/reward_box.png new file mode 100644 index 00000000..06679cbf Binary files /dev/null and b/public/picture/aijiu/reward_box.png differ diff --git a/public/picture/aijiu/sign.png b/public/picture/aijiu/sign.png new file mode 100644 index 00000000..504c94c4 Binary files /dev/null and b/public/picture/aijiu/sign.png differ