Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
e5fbfe2993
@ -125,7 +125,7 @@ class WarehouseProductLogic extends BaseLogic
|
|||||||
if ($params['order_type'] != 6) {
|
if ($params['order_type'] != 6) {
|
||||||
$storege = WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id', $params['product_id'])->find();
|
$storege = WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id', $params['product_id'])->find();
|
||||||
if ($storege) {
|
if ($storege) {
|
||||||
if($params['order_type']!=7){
|
if(in_array($params['order_type'],[1,4])){
|
||||||
SystemStoreStorage::create([
|
SystemStoreStorage::create([
|
||||||
'store_id' => $params['store_id'],
|
'store_id' => $params['store_id'],
|
||||||
'admin_id' => $params['admin_id'],
|
'admin_id' => $params['admin_id'],
|
||||||
|
@ -13,7 +13,10 @@ class DemoLogic extends BaseLogic
|
|||||||
$arr = Db::name('ceshi_two')->select();
|
$arr = Db::name('ceshi_two')->select();
|
||||||
foreach ($arr as $k => $v) {
|
foreach ($arr as $k => $v) {
|
||||||
//门店供货、商户、零售
|
//门店供货、商户、零售
|
||||||
StoreProduct::where('id', $v['product_id'])->update(['purchase' => $v['price'], 'cost' => bcadd($v['price1'], 0, 2), 'vip_price' => bcadd($v['price1'], 0, 2), 'price' => bcadd($v['price6'], 0, 2)]);
|
$res=StoreProduct::where('id', $v['product_id'])->update(['purchase' => $v['price'], 'cost' => bcadd($v['price1'], 0, 2), 'vip_price' => bcadd($v['price1'], 0, 2), 'price' => bcadd($v['price6'], 0, 2)]);
|
||||||
|
if($res){
|
||||||
|
Db::name('ceshi_two')->where('product_id', $v['product_id'])->update(['status' => 1]);
|
||||||
|
}
|
||||||
//种养殖
|
//种养殖
|
||||||
$find = Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 5)->find();
|
$find = Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 5)->find();
|
||||||
if ($find) {
|
if ($find) {
|
||||||
@ -21,13 +24,20 @@ class DemoLogic extends BaseLogic
|
|||||||
} else {
|
} else {
|
||||||
Db::name('store_product_group_price')->insert(['product_id' => $v['product_id'], 'group_id' => 5, 'price' => bcadd($v['price8'], 0, 2), 'price_type' => 3, 'base_rate' => bcadd(bcmul($v['lv8'], 100), 100, 2)]);
|
Db::name('store_product_group_price')->insert(['product_id' => $v['product_id'], 'group_id' => 5, 'price' => bcadd($v['price8'], 0, 2), 'price_type' => 3, 'base_rate' => bcadd(bcmul($v['lv8'], 100), 100, 2)]);
|
||||||
}
|
}
|
||||||
//酒店
|
//食堂
|
||||||
$find2 = Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 7)->find();
|
$find2 = Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 7)->find();
|
||||||
if ($find2) {
|
if ($find2) {
|
||||||
Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 7)->update(['price' => bcadd($v['price3'], 0, 2)]);
|
Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 7)->update(['price' => bcadd($v['price3'], 0, 2)]);
|
||||||
} else {
|
} else {
|
||||||
Db::name('store_product_group_price')->insert(['product_id' => $v['product_id'], 'group_id' => 7, 'price' => bcadd($v['price3'], 0, 2), 'price_type' => 3, 'base_rate' => bcadd(bcmul($v['lv3'], 100), 100, 2)]);
|
Db::name('store_product_group_price')->insert(['product_id' => $v['product_id'], 'group_id' => 7, 'price' => bcadd($v['price3'], 0, 2), 'price_type' => 3, 'base_rate' => bcadd(bcmul($v['lv3'], 100), 100, 2)]);
|
||||||
}
|
}
|
||||||
|
//酒店
|
||||||
|
$find2 = Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 6)->find();
|
||||||
|
if ($find2) {
|
||||||
|
Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 6)->update(['price' => bcadd($v['price3'], 0, 2)]);
|
||||||
|
} else {
|
||||||
|
Db::name('store_product_group_price')->insert(['product_id' => $v['product_id'], 'group_id' => 6, 'price' => bcadd($v['price3'], 0, 2), 'price_type' => 3, 'base_rate' => bcadd(bcmul($v['lv3'], 100), 100, 2)]);
|
||||||
|
}
|
||||||
//一条龙
|
//一条龙
|
||||||
$find3 = Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 18)->find();
|
$find3 = Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 18)->find();
|
||||||
if ($find3) {
|
if ($find3) {
|
||||||
@ -50,7 +60,6 @@ class DemoLogic extends BaseLogic
|
|||||||
Db::name('store_product_group_price')->insert(['product_id' => $v['product_id'], 'group_id' => 19, 'price' => bcadd($v['price2'], 0, 2), 'price_type' => 3, 'base_rate' => bcadd(bcmul($v['lv2'], 100), 100, 2)]);
|
Db::name('store_product_group_price')->insert(['product_id' => $v['product_id'], 'group_id' => 19, 'price' => bcadd($v['price2'], 0, 2), 'price_type' => 3, 'base_rate' => bcadd(bcmul($v['lv2'], 100), 100, 2)]);
|
||||||
}
|
}
|
||||||
//食堂会员
|
//食堂会员
|
||||||
|
|
||||||
$find4 = Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 20)->find();
|
$find4 = Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 20)->find();
|
||||||
if ($find4) {
|
if ($find4) {
|
||||||
Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 20)->update(['price' => bcadd($v['price4'], 0, 2)]);
|
Db::name('store_product_group_price')->where('product_id', $v['product_id'])->where('group_id', 20)->update(['price' => bcadd($v['price4'], 0, 2)]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user