|
|
@@ -24,6 +24,7 @@ use app\services\system\attachment\SystemAttachmentServices;
|
|
|
use app\services\system\config\SystemConfigServices;
|
|
|
use app\services\store\SystemStoreServices;
|
|
|
use app\services\store\SystemStoreStaffServices;
|
|
|
+use app\services\user\UserAwardIntegralServices;
|
|
|
use app\services\user\UserBillServices;
|
|
|
use app\services\user\UserInvoiceServices;
|
|
|
use app\services\user\UserServices;
|
|
|
@@ -50,7 +51,7 @@ class PublicController extends BaseController
|
|
|
*/
|
|
|
public function index(Request $request)
|
|
|
{
|
|
|
- $uid = $request->hasMacro('uid') ? (int)$request->uid() : 0;
|
|
|
+ $uid = $request->hasMacro('uid') ? (int)$request->uid() : 0;
|
|
|
$banner = sys_data('routine_home_banner') ?: [];// 首页banner图
|
|
|
$menus = sys_data('routine_home_menus') ?: [];// 首页按钮
|
|
|
$roll = sys_data('routine_home_roll_news') ?: [];// 首页滚动新闻
|
|
|
@@ -92,7 +93,10 @@ class PublicController extends BaseController
|
|
|
}
|
|
|
$newGoodsBananr = sys_config('new_goods_bananr');
|
|
|
$tengxun_map_key = sys_config('tengxun_map_key');
|
|
|
- return app('json')->successful(compact('banner', 'menus', 'roll', 'info', 'activity', 'lovely', 'benefit', 'likeInfo', 'logoUrl', 'site_name', 'subscribe', 'newGoodsBananr', 'tengxun_map_key', 'explosive_money'));
|
|
|
+ $award_integral_service = app()->make(UserAwardIntegralServices::class);
|
|
|
+ $award_lack = $award_integral_service->getLake();
|
|
|
+ $integral_price = $award_integral_service->getPrice();
|
|
|
+ return app('json')->successful(compact('award_lack', 'integral_price', 'banner', 'menus', 'roll', 'info', 'activity', 'lovely', 'benefit', 'likeInfo', 'logoUrl', 'site_name', 'subscribe', 'newGoodsBananr', 'tengxun_map_key', 'explosive_money'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -205,26 +209,26 @@ class PublicController extends BaseController
|
|
|
$routine_contact_type = sys_config('routine_contact_type', 0);
|
|
|
/** @var DiyServices $diyServices */
|
|
|
$diyServices = app()->make(DiyServices::class);
|
|
|
- $diy_data = $diyServices->cacheRemember('diy_data_member_3', function () use ($diyServices) {
|
|
|
- $diy_data = $diyServices->get(['template_name' => 'member', 'type' => 3], ['value', 'status', 'order_status', 'my_banner_status', 'menu_status', 'service_status']);
|
|
|
- $diy_data = $diy_data ? $diy_data->toArray() : [];
|
|
|
- return $diy_data;
|
|
|
- });
|
|
|
- if ($diy_data) {
|
|
|
- $diy_value = json_decode($diy_data['value'], true);
|
|
|
- $new_value = [];
|
|
|
- if (is_int($diy_value)) {
|
|
|
- $new_value['status'] = $diy_value;
|
|
|
- $new_value['vip_type'] = 1;
|
|
|
- $new_value['newcomer_status'] = 1;
|
|
|
- $new_value['newcomer_style'] = 1;
|
|
|
- } else {
|
|
|
- $new_value = $diy_value;
|
|
|
- }
|
|
|
- $diy_data = array_merge($diy_data, $new_value);
|
|
|
- $diy_data['order_status'] = (int)$diy_data['order_status'];
|
|
|
- }
|
|
|
- unset($diy_data['value']);
|
|
|
+ $diy_data = $diyServices->cacheRemember('diy_data_member_3', function () use ($diyServices) {
|
|
|
+ $diy_data = $diyServices->get(['template_name' => 'member', 'type' => 3], ['value', 'status', 'order_status', 'my_banner_status', 'menu_status', 'service_status']);
|
|
|
+ $diy_data = $diy_data ? $diy_data->toArray() : [];
|
|
|
+ return $diy_data;
|
|
|
+ });
|
|
|
+ if ($diy_data) {
|
|
|
+ $diy_value = json_decode($diy_data['value'], true);
|
|
|
+ $new_value = [];
|
|
|
+ if (is_int($diy_value)) {
|
|
|
+ $new_value['status'] = $diy_value;
|
|
|
+ $new_value['vip_type'] = 1;
|
|
|
+ $new_value['newcomer_status'] = 1;
|
|
|
+ $new_value['newcomer_style'] = 1;
|
|
|
+ } else {
|
|
|
+ $new_value = $diy_value;
|
|
|
+ }
|
|
|
+ $diy_data = array_merge($diy_data, $new_value);
|
|
|
+ $diy_data['order_status'] = (int)$diy_data['order_status'];
|
|
|
+ }
|
|
|
+ unset($diy_data['value']);
|
|
|
return app('json')->successful(['routine_my_menus' => array_merge($menusInfo), 'routine_my_banner' => $my_banner, 'routine_spread_banner' => $bannerInfo, 'routine_contact_type' => $routine_contact_type, 'diy_data' => $diy_data]);
|
|
|
}
|
|
|
|
|
|
@@ -370,12 +374,12 @@ class PublicController extends BaseController
|
|
|
['image', ''],
|
|
|
['code', ''],
|
|
|
], true);
|
|
|
- if ($imageUrl !== '' && !preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $imageUrl)) {
|
|
|
- return app('json')->success(['code' => false, 'image' => false]);
|
|
|
- }
|
|
|
- if ($codeUrl !== '' && !(preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $codeUrl) || strpos($codeUrl, 'https://mp.weixin.qq.com/cgi-bin/showqrcode') !== false)) {
|
|
|
- return app('json')->success(['code' => false, 'image' => false]);
|
|
|
- }
|
|
|
+ if ($imageUrl !== '' && !preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $imageUrl)) {
|
|
|
+ return app('json')->success(['code' => false, 'image' => false]);
|
|
|
+ }
|
|
|
+ if ($codeUrl !== '' && !(preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $codeUrl) || strpos($codeUrl, 'https://mp.weixin.qq.com/cgi-bin/showqrcode') !== false)) {
|
|
|
+ return app('json')->success(['code' => false, 'image' => false]);
|
|
|
+ }
|
|
|
try {
|
|
|
$code = CacheService::get($codeUrl, function () use ($codeUrl) {
|
|
|
$codeTmp = $code = $codeUrl ? image_to_base64($codeUrl) : false;
|
|
|
@@ -418,14 +422,14 @@ class PublicController extends BaseController
|
|
|
['latitude', ''],
|
|
|
['longitude', ''],
|
|
|
['product_id', 0],
|
|
|
- ['type', 0],//商品类型 0:普通 1:秒杀
|
|
|
+ ['type', 0],//商品类型 0:普通 1:秒杀
|
|
|
['is_store', 1], //前端传值为 1|商城配送 2|门店自提 3|门店配送
|
|
|
['store_id', 0], //前端传值为 1|商城配送 2|门店自提 3|门店配送
|
|
|
], true);
|
|
|
//判断是否门店自提
|
|
|
$is_store == 2 ? $is_store = 1 : $is_store = '';
|
|
|
- $where = ['type' => 0, 'is_store' => $is_store];
|
|
|
- $field = ['id', 'name', 'phone', 'image', 'latitude', 'longitude', 'address', 'detailed_address', 'is_show', 'is_store', 'day_time', 'day_start', 'day_end', 'valid_range'];
|
|
|
+ $where = ['type' => 0, 'is_store' => $is_store];
|
|
|
+ $field = ['id', 'name', 'phone', 'image', 'latitude', 'longitude', 'address', 'detailed_address', 'is_show', 'is_store', 'day_time', 'day_start', 'day_end', 'valid_range'];
|
|
|
$data['list'] = $services->getStoreList($where, $field, $latitude, $longitude, (int)$product_id, [], (int)$type, $store_id);
|
|
|
$data['tengxun_map_key'] = sys_config('tengxun_map_key');
|
|
|
return app('json')->successful($data);
|
|
|
@@ -449,13 +453,13 @@ class PublicController extends BaseController
|
|
|
*/
|
|
|
public function pink(Request $request, StorePinkServices $pink, UserServices $user)
|
|
|
{
|
|
|
- [$type] = $request->getMore([
|
|
|
+ [$type] = $request->getMore([
|
|
|
['type', 1],
|
|
|
], true);
|
|
|
- $where = ['is_refund' => 0];
|
|
|
- if ($type == 1) {
|
|
|
- $where['status'] = 2;
|
|
|
- }
|
|
|
+ $where = ['is_refund' => 0];
|
|
|
+ if ($type == 1) {
|
|
|
+ $where['status'] = 2;
|
|
|
+ }
|
|
|
$data['pink_count'] = $pink->getCount($where);
|
|
|
$uids = array_flip($pink->getColumn($where, 'uid'));
|
|
|
if (count($uids)) {
|
|
|
@@ -507,18 +511,18 @@ class PublicController extends BaseController
|
|
|
return app('json')->successful($services->getDiyInfo((int)$id));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @param DiyServices $services
|
|
|
- * @param int $id
|
|
|
- * @return mixed
|
|
|
- * @author 等风来
|
|
|
- * @email 136327134@qq.com
|
|
|
- * @date 2022/11/9
|
|
|
- */
|
|
|
- public function getDiyVersion(DiyServices $services, $id = 0)
|
|
|
- {
|
|
|
- return app('json')->successful(['version' => $services->getDiyVersion((int)$id)]);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * @param DiyServices $services
|
|
|
+ * @param int $id
|
|
|
+ * @return mixed
|
|
|
+ * @author 等风来
|
|
|
+ * @email 136327134@qq.com
|
|
|
+ * @date 2022/11/9
|
|
|
+ */
|
|
|
+ public function getDiyVersion(DiyServices $services, $id = 0)
|
|
|
+ {
|
|
|
+ return app('json')->successful(['version' => $services->getDiyVersion((int)$id)]);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 获取底部导航
|
|
|
@@ -567,8 +571,8 @@ class PublicController extends BaseController
|
|
|
/** @var CacheServices $cache */
|
|
|
$cache = app()->make(CacheServices::class);
|
|
|
$data = $cache->getDbCache('open_adv', '');
|
|
|
- $data['time'] = (float)($data['time'] ?? 3);
|
|
|
- $data['interval_time'] = (float)($data['interval_time'] ?? 24);
|
|
|
+ $data['time'] = (float)($data['time'] ?? 3);
|
|
|
+ $data['interval_time'] = (float)($data['interval_time'] ?? 24);
|
|
|
return app('json')->success($data);
|
|
|
}
|
|
|
|
|
|
@@ -595,49 +599,49 @@ class PublicController extends BaseController
|
|
|
$copyright = $this->__z6uxyJQ4xYa5ee1mx5();
|
|
|
} catch (\Throwable $e) {
|
|
|
$copyright = [
|
|
|
- 'copyrightContext' => '',
|
|
|
- 'copyrightImage' => '',
|
|
|
- ];
|
|
|
+ 'copyrightContext' => '',
|
|
|
+ 'copyrightImage' => '',
|
|
|
+ ];
|
|
|
}
|
|
|
- $copyright['record_No'] = sys_config('record_No');
|
|
|
- $copyright['version'] = get_crmeb_version();
|
|
|
- $copyright['routine_contact_type'] = sys_config('routine_contact_type');
|
|
|
- $copyright['store_user_agreement'] = (int)sys_config('store_user_agreement');
|
|
|
- $copyright['routine_auth_type'] = sys_config('routine_auth_type', []);
|
|
|
- $copyright['wechat_auth_switch'] = (int)in_array(1, $copyright['routine_auth_type']);//微信登录开关
|
|
|
- $copyright['phone_auth_switch'] = (int)in_array(2, $copyright['routine_auth_type']);//手机号登录开关
|
|
|
- $copyright['site_name'] = sys_config('site_name', '');
|
|
|
- $copyright['site_logo'] = sys_config('wap_login_logo', '');
|
|
|
- $copyright['wechat_status'] = sys_config('wechat_appid') && sys_config('wechat_appsecret');
|
|
|
+ $copyright['record_No'] = sys_config('record_No');
|
|
|
+ $copyright['version'] = get_crmeb_version();
|
|
|
+ $copyright['routine_contact_type'] = sys_config('routine_contact_type');
|
|
|
+ $copyright['store_user_agreement'] = (int)sys_config('store_user_agreement');
|
|
|
+ $copyright['routine_auth_type'] = sys_config('routine_auth_type', []);
|
|
|
+ $copyright['wechat_auth_switch'] = (int)in_array(1, $copyright['routine_auth_type']);//微信登录开关
|
|
|
+ $copyright['phone_auth_switch'] = (int)in_array(2, $copyright['routine_auth_type']);//手机号登录开关
|
|
|
+ $copyright['site_name'] = sys_config('site_name', '');
|
|
|
+ $copyright['site_logo'] = sys_config('wap_login_logo', '');
|
|
|
+ $copyright['wechat_status'] = sys_config('wechat_appid') && sys_config('wechat_appsecret');
|
|
|
return $this->success($copyright);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 登录页面获取logo以及版本全新
|
|
|
- * @return mixed
|
|
|
- */
|
|
|
- public function getLogo()
|
|
|
- {
|
|
|
- try {
|
|
|
+ /**
|
|
|
+ * 登录页面获取logo以及版本全新
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function getLogo()
|
|
|
+ {
|
|
|
+ try {
|
|
|
$copyright = $this->__z6uxyJQ4xYa5ee1mx5();
|
|
|
} catch (\Throwable $e) {
|
|
|
$copyright = [
|
|
|
- 'copyrightContext' => '',
|
|
|
- 'copyrightImage' => '',
|
|
|
- ];
|
|
|
+ 'copyrightContext' => '',
|
|
|
+ 'copyrightImage' => '',
|
|
|
+ ];
|
|
|
}
|
|
|
- $copyright['record_No'] = sys_config('record_No');
|
|
|
- $copyright['version'] = get_crmeb_version();
|
|
|
- $logo = sys_config('wap_login_logo');
|
|
|
+ $copyright['record_No'] = sys_config('record_No');
|
|
|
+ $copyright['version'] = get_crmeb_version();
|
|
|
+ $logo = sys_config('wap_login_logo');
|
|
|
if (strstr($logo, 'http') === false && $logo) $logo = sys_config('site_url') . $logo;
|
|
|
- $copyright['site_name'] = sys_config('site_name');
|
|
|
- $copyright['logo_url'] = str_replace('\\', '/', $logo);
|
|
|
- $copyright['store_user_agreement'] = (int)sys_config('store_user_agreement');
|
|
|
- $copyright['routine_auth_type'] = sys_config('routine_auth_type', []);
|
|
|
- $copyright['wechat_auth_switch'] = (int)in_array(1, $copyright['routine_auth_type']);//微信登录开关
|
|
|
- $copyright['phone_auth_switch'] = (int)in_array(2, $copyright['routine_auth_type']);//手机号登录开关
|
|
|
- $copyright['wechat_status'] = sys_config('wechat_appid') && sys_config('wechat_appsecret');
|
|
|
+ $copyright['site_name'] = sys_config('site_name');
|
|
|
+ $copyright['logo_url'] = str_replace('\\', '/', $logo);
|
|
|
+ $copyright['store_user_agreement'] = (int)sys_config('store_user_agreement');
|
|
|
+ $copyright['routine_auth_type'] = sys_config('routine_auth_type', []);
|
|
|
+ $copyright['wechat_auth_switch'] = (int)in_array(1, $copyright['routine_auth_type']);//微信登录开关
|
|
|
+ $copyright['phone_auth_switch'] = (int)in_array(2, $copyright['routine_auth_type']);//手机号登录开关
|
|
|
+ $copyright['wechat_status'] = sys_config('wechat_appid') && sys_config('wechat_appsecret');
|
|
|
return app('json')->successful($copyright);
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
}
|