当前位置:网站首页>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);
}边栏推荐
- Is it safe to open an account and buy stocks on the Internet?
- confluence7.4. X upgrade record
- JS monitors the width and height changes of div
- 20. MVVM command binding of WPF
- R language dplyr package summary_ The at function calculates the count number, mean and median of multiple data columns (specified by vectors) in the dataframe data, and specifies na RM parameter, spe
- The latest IT learning route in 2020
- R语言使用nnet包的multinom函数构建无序多分类logistic回归模型、使用summary函数获取模型汇总统计信息
- [regression analysis] understand ridge regression with case teaching
- The cloud native data lake has passed the evaluation and certification of the ICT Institute with its storage, computing, data management and other capabilities
- Uncover gaussdb (for redis): comprehensive comparison of CODIS
猜你喜欢

刷入Magisk通用方法

flutter常用命令及问题

Use PHP script to view the opened extensions

Explain factor analysis in simple terms, with case teaching (full)

Why do we do autocorrelation analysis? Explain application scenarios and specific operations

Uncover gaussdb (for redis): comprehensive comparison of CODIS

Execution order of MySQL query statements join, on and where

黑馬暢購商城---3.商品管理

What is principal component analysis? Dimension reduction of classical case analysis variables
![[oceanbase] Introduction to oceanbase and its comparison with MySQL](/img/1c/bd2bcddb7af4647407d2bc351f5f5d.png)
[oceanbase] Introduction to oceanbase and its comparison with MySQL
随机推荐
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
R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用stress.type参数指定强调线的id子集的线条的类型(type)
ECSHOP product attribute color specification size stock item No. automatic combination
Mysql database logs binlog save aging (expire\u logs\u days)
ECSHOP quickly purchases goods, simplifies the shopping process, and improves the user experience through one-step shopping
Kotlin基础
Renrenyue -- renrenyue system development source code sharing
如果你也想做自媒体,不妨听大周给您点建议
R language dplyr package filter function filters the data rows in the specified list whose contents in the dataframe data are not (not equal to one of the specified vectors)
ECSHOP commodity wholesale multi attribute multi specification multi inventory batch purchase ECSHOP wholesale plug-in ECSHOP multi attribute order
Gradle知识点
Uncover gaussdb (for redis): comprehensive comparison of CODIS
Explanation of ideas and sharing of pre-processing procedures for 2021 US game D (with pre-processing data code)
SDN系统方法 | 9. 接入网
The R language cartools package divides data, the scale function scales data, and the NaiveBayes function of e1071 package constructs a naive Bayesian model
揭秘GaussDB(for Redis):全面對比Codis
Arm V7 coprocessor
Dark horse shopping mall ---8 Microservice gateway and JWT token
Effective reading of literature
An easy-to-use seal design tool - (can be converted to ofd file)