This commit is contained in:
gongfuxiang
2024-04-15 10:25:01 +08:00
parent 774ca894ea
commit bbf5906e20
596 changed files with 25192 additions and 9384 deletions

View File

@ -82,11 +82,11 @@ class Article extends Common
$start = intval(($this->page-1)*$this->page_size);
// 获取列表
$data_params = [
$data_params = array_merge($params, [
'm' => $start,
'n' => $this->page_size,
'where' => $where,
];
]);
$data = ArticleService::ArticleList($data_params);
// 返回数据

View File

@ -47,6 +47,7 @@ class Common extends BaseController
// 分页信息
protected $page;
protected $page_size;
protected $page_start;
// 动态表格
protected $form_table;
@ -212,7 +213,8 @@ class Common extends BaseController
// 分页信息
$this->page = max(1, isset($this->data_request['page']) ? intval($this->data_request['page']) : 1);
$this->page_size = 15;
$this->page_size = min(empty($this->data_request['page_size']) ? MyC('common_page_size', 15, true) : intval($this->data_request['page_size']), 1000);
$this->page_start = intval(($this->page-1)*$this->page_size);
}
/**

View File

@ -60,19 +60,18 @@ class Goods extends Common
{
$ret = DataReturn(MyLang('params_error_tips'), -1);
} else {
// 商品详情方式
$is_use_mobile_detail = intval(MyC('common_app_is_use_mobile_detail'));
// 是否独立手机端详情
$is_use_mobile_detail = intval(MyC('common_app_is_use_mobile_detail', 0, true));
// 获取商品
$params = [
'where' => [
'where' => [
['id', '=', $goods_id],
['is_delete_time', '=', 0],
],
'is_photo' => true,
'is_spec' => true,
'is_params' => true,
'is_content_app' => ($is_use_mobile_detail == 1),
'is_content_app' => $is_use_mobile_detail,
'is_spec' => 1,
'is_params' => 1,
'is_favor' => 1,
];
$ret = GoodsService::GoodsList($params);
if(empty($ret['data'][0]) || $ret['data'][0]['is_delete_time'] != 0)
@ -91,10 +90,6 @@ class Goods extends Common
$goods['content_web'] = ResourcesService::ApMiniRichTextContentHandle($goods['content_web']);
}
// 当前登录用户是否已收藏
$ret_favor = GoodsFavorService::IsUserGoodsFavor(['goods_id'=>$goods_id, 'user'=>$this->user]);
$goods['is_favor'] = ($ret_favor['code'] == 0) ? $ret_favor['data'] : 0;
// 商品评价总数
$goods['comments_count'] = GoodsCommentsService::GoodsCommentsTotal(['goods_id'=>$goods_id, 'is_show'=>1]);
// 评分

View File

@ -32,55 +32,68 @@ use app\service\GoodsCartService;
*/
class Index extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
}
// 调用父类前置方法
parent::__construct();
}
/**
* [Index 入口]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-05-25T11:03:59+0800
*/
public function Index()
{
// 数据模式
if(MyC('home_index_floor_data_type', 0, true) == 2)
/**
* 首页
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-05-25T11:03:59+0800
*/
public function Index()
{
$key = 'api_index_data_'.APPLICATION_CLIENT_TYPE;
$result = MyCache($key);
if(empty($result) || (isset($this->data_request['is_cache']) && $this->data_request['is_cache'] == 0))
{
$data_list = LayoutService::LayoutConfigData('home');
// 数据模式
if(MyC('home_index_floor_data_type', 0, true) == 2)
{
$data_list = LayoutService::LayoutConfigData('home');
} else {
$data_list = GoodsService::HomeFloorList();
}
// 购物车汇总
$cart_total = GoodsCartService::UserGoodsCartTotal(['user'=>$this->user]);
// 未读消息总数
$params = ['user'=>$this->user, 'is_more'=>1, 'is_read'=>0];
$message_total = MessageService::UserMessageTotal($params);
// 返回数据
$result = SystemBaseService::DataReturn([
'navigation' => AppHomeNavService::AppHomeNav(),
'banner_list' => BannerService::Banner(),
'data_list' => $data_list,
'article_list' => ArticleService::RecommendedArticleList(),
'right_icon_list' => AppService::HomeRightIconList(['message_total'=>$message_total]),
'cart_total' => $cart_total,
'message_total' => $message_total,
'plugins_sort_list' => PluginsService::PluginsSortList(),
]);
// 缓存数据购物车数量设置0
$cache_result = $result;
$cache_result['data']['cart_total'] = ['total_price'=>0, 'buy_number'=>0];
$cache_result['data']['message_total'] = 0;
MyCache($key, $cache_result, 3600);
} else {
$data_list = GoodsService::HomeFloorList();
$result['data']['is_result_data_cache'] = 1;
}
// 购物车汇总
$cart_total = GoodsCartService::UserGoodsCartTotal(['user'=>$this->user]);
// 未读消息总数
$params = ['user'=>$this->user, 'is_more'=>1, 'is_read'=>0];
$message_total = MessageService::UserMessageTotal($params);
// 返回数据
$result = [
'navigation' => AppHomeNavService::AppHomeNav(),
'banner_list' => BannerService::Banner(),
'data_list' => $data_list,
'article_list' => ArticleService::HomeArticleList(),
'right_icon_list' => AppService::HomeRightIconList(['message_total'=>$message_total]),
'cart_total' => $cart_total,
'message_total' => $message_total,
'plugins_sort_list' => PluginsService::PluginsSortList(),
];
return ApiService::ApiDataReturn(SystemBaseService::DataReturn($result));
}
return ApiService::ApiDataReturn($result);
}
}
?>

View File

@ -38,6 +38,20 @@ class Safety extends Common
$this->IsLogin();
}
/**
* 登录密码修改
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-28T10:38:23+0800
*/
public function LoginPwdUpdate()
{
$params = $this->data_request;
$params['user'] = $this->user;
return ApiService::ApiDataReturn(SafetyService::LoginPwdUpdate($params));
}
/**
* 账号注销
* @author Devil

View File

@ -150,6 +150,32 @@ class User extends Common
return ApiService::ApiDataReturn(UserService::AppMobileBindVerifySend($this->data_request));
}
/**
* app用户邮箱绑定
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public function AppEmailBind()
{
return ApiService::ApiDataReturn(UserService::AppEmailBind($this->data_request));
}
/**
* app用户邮箱绑定-验证码发送
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public function AppEmailBindVerifySend()
{
return ApiService::ApiDataReturn(UserService::AppEmailBindVerifySend($this->data_request));
}
/**
* 用户-验证码显示
* @author Devil