当前位置:网站首页>Happy shopkeeper source code -- Introduction to happy shopkeeper system development mode
Happy shopkeeper source code -- Introduction to happy shopkeeper system development mode
2022-06-25 12:28:00 【Procedure 15528175269】
For enterprises participating in advertising e-commerce , Advertising e-commerce is a long process , In this process, enterprises should draw up a long-term development plan for e-commerce , Instead of rushing for success . The positioning of enterprises should be accurate ,“ Communicative E-commerce ” It gives enterprises more opportunities to directly touch the policy consumers , Therefore, enterprises should find out their own positioning .
Some core codes of the happy shopkeeper system are shared :
public function confirm(Request $request)
{
$temp = ShippingTemplates::get(1);
if (!$temp) return app('json')->fail(' The default template is not configured , Can't place an order ');
list($cartId) = UtilService::postMore(['cartId'], $request, true);
if (!is_string($cartId) || !$cartId) return app('json')->fail(' Please submit the purchased goods ');
$uid = $request->uid();
$cartGroup = StoreCart::getUserProductCartList($uid, $cartId, 1);
if (count($cartGroup['invalid'])) return app('json')->fail($cartGroup['invalid'][0]['productInfo']['store_name'] . ' Has lapsed !');
if (!$cartGroup['valid']) return app('json')->fail(' Please submit the purchased goods ');
$cartInfo = $cartGroup['valid'];
$addr = UserAddress::where('uid', $uid)->where('is_default', 1)->find();
$priceGroup = StoreOrder::getOrderPriceGroup($cartInfo, $addr);
if ($priceGroup === false) {
return app('json')->fail(StoreOrder::getErrorInfo(' Freight template does not exist '));
}
$other = [
'offlinePostage' => sys_config('offline_postage'),
'integralRatio' => sys_config('integral_ratio')
];
$usableCoupons = StoreCouponUser::getUsableCouponList($uid, $cartGroup, $priceGroup['totalPrice']);
$usableCoupon = isset($usableCoupons[0]) ? $usableCoupons[0] : null;
$cartIdA = explode(',', $cartId);
$seckill_id = 0;
$combination_id = 0;
$bargain_id = 0;
$box_id = 0;
if (count($cartIdA) == 1) {
$seckill_id = StoreCart::where('id', $cartId)->value('seckill_id');
$combination_id = StoreCart::where('id', $cartId)->value('combination_id');
$bargain_id = StoreCart::where('id', $cartId)->value('bargain_id');
$box_id = StoreCart::where('id', $cartId)->value('box_id');
}
$data['deduction'] = $seckill_id || $combination_id || $bargain_id || $box_id;
$data['usableCoupon'] = $usableCoupon;
$data['addressInfo'] = UserAddress::getUserDefaultAddress($uid);
$data['seckill_id'] = $seckill_id;
$data['combination_id'] = $combination_id;
$data['bargain_id'] = $bargain_id;
$data['box_id'] = $box_id;
$data['cartInfo'] = $cartInfo;
$data['priceGroup'] = $priceGroup;
$data['orderKey'] = StoreOrder::cacheOrderInfo($uid, $cartInfo, $priceGroup, $other);
$data['offlinePostage'] = $other['offlinePostage'];
$vipId = UserLevel::getUserLevel($uid);
$user = $request->user();
if (isset($user['pwd'])) unset($user['pwd']);
$user['vip'] = $vipId !== false ? true : false;
if ($user['vip']) {
$user['vip_id'] = $vipId;
$user['discount'] = UserLevel::getUserLevelInfo($vipId, 'discount');
}
$data['userInfo'] = $user;
$data['integralRatio'] = $other['integralRatio'];
$data['offline_pay_status'] = (int)sys_config('offline_pay_status') ?? (int)2;
$data['store_self_mention'] = (int)sys_config('store_self_mention') ?? 0;// Whether store self collection is enabled
$data['system_store'] = ($res = SystemStore::getStoreDispose()) ? $res : [];// Store information
return app('json')->successful($data);
}
边栏推荐
- Renrenyue -- renrenyue system development source code sharing
- The latest IT learning route in 2020
- R语言caTools包进行数据划分、scale函数进行数据缩放、e1071包的naiveBayes函数构建朴素贝叶斯模型
- 做自媒体视频需要怎么做才能年收入一百万?
- An example of using dynamic datalist
- Mpai data science platform SVM support vector machine classification \ explanation of regression parameter adjustment
- The dist function of R language calculates the distance between two samples in dataframe data, returns the distance matrix between samples, and specifies the distance calculation method through the me
- If you also want to be we media, you might as well listen to Da Zhou's advice
- 刷入Magisk通用方法
- Architects reveal the difference between working in Alibaba, Tencent and meituan
猜你喜欢
ECSHOP upload video_ ECSHOP video list, video classification, video related product guide
What is Flink? What can Flink do?
plt.gca()画框及打标签
Découvrir gaussdb (pour redis): une comparaison complète avec Codis
Upgrade opsenssh to 8.8p1
What are redis avalanche, penetration and breakdown?
2022年首期Techo Day腾讯技术开放日将于6月28日线上举办
How to use SPSS to do grey correlation analysis? Quick grasp of hand-to-hand Teaching
[oceanbase] Introduction to oceanbase and its comparison with MySQL
ECSHOP quickly purchases goods, simplifies the shopping process, and improves the user experience through one-step shopping
随机推荐
JS monitors the width and height changes of div
Gradle知识点
图片打标签之获取图片在ImageView中的坐标
设置图片的透明度从左到右渐变
A set of automated paperless office system (oa+ approval process) source code: with data dictionary
Architects reveal the difference between working in Alibaba, Tencent and meituan
Why can't you Ping the website but you can access it?
flutter常用命令及问题
RecyclerView滚动到指定位置
实现领域驱动设计 - 使用ABP框架 - 系列文章汇总
动态代理
Why should Apple change objc_ Type declaration for msgsend
做自媒体视频需要怎么做才能年收入一百万?
Repair the error that ECSHOP background orders prompt insufficient inventory when adding goods. Please reselect
【数据中台】数据中台的OneID是个什么鬼,主数据它不香吗?
plt.gca()画框及打标签
R language uses GLM function to build Poisson logarithmic linear regression model, processes three-dimensional contingency table data to build saturation model, and poisgof function of epidisplay pack
thinkphp3.2.5 GIF. class. php for php7.4
Black Horse Chang Shopping Mall - - - 3. Gestion des produits de base
Dark horse shopping mall ---2 Distributed file storage fastdfs