Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
02da718a
ShopXO
项目概览
飞鱼0526
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
02da718a
编写于
7月 17, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
库存管理,部分细节优化
上级
dd0a77e8
变更
16
显示空白变更内容
内联
并排
Showing
16 changed file
with
130 addition
and
497 deletion
+130
-497
application/admin/form/Appminialipaylist.php
application/admin/form/Appminialipaylist.php
+0
-87
application/admin/form/Appminibaidulist.php
application/admin/form/Appminibaidulist.php
+0
-87
application/admin/form/Appminiqqlist.php
application/admin/form/Appminiqqlist.php
+0
-87
application/admin/form/Appminitoutiaolist.php
application/admin/form/Appminitoutiaolist.php
+0
-87
application/admin/form/Appminiweixinlist.php
application/admin/form/Appminiweixinlist.php
+0
-87
application/admin/form/Customview.php
application/admin/form/Customview.php
+1
-1
application/admin/form/Goodsbrowse.php
application/admin/form/Goodsbrowse.php
+1
-1
application/admin/form/Goodsfavor.php
application/admin/form/Goodsfavor.php
+1
-1
application/admin/view/default/warehouse/module/operate.html
application/admin/view/default/warehouse/module/operate.html
+1
-1
application/admin/view/default/warehouse/save_info.html
application/admin/view/default/warehouse/save_info.html
+1
-1
application/index/view/default/useraddress/save_info.html
application/index/view/default/useraddress/save_info.html
+5
-5
application/service/GoodsService.php
application/service/GoodsService.php
+1
-1
application/service/WarehouseGoodsService.php
application/service/WarehouseGoodsService.php
+8
-8
application/service/WarehouseService.php
application/service/WarehouseService.php
+64
-2
changelog.txt
changelog.txt
+6
-2
config/shopxo.sql
config/shopxo.sql
+41
-39
未找到文件。
application/admin/form/Appminialipaylist.php
已删除
100644 → 0
浏览文件 @
dd0a77e8
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\admin\form
;
/**
* 支付宝小程序管理动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-22
* @desc description
*/
class
Appminialipaylist
{
// 基础条件
public
$condition_base
=
[];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-22
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Run
(
$params
=
[])
{
return
[
// 基础配置
'base'
=>
[
'key_field'
=>
'name'
,
'is_delete'
=>
1
,
'delete_url'
=>
MyUrl
(
'admin/appminialipaylist/delete'
),
'delete_key'
=>
'ids'
,
],
// 表单配置
'form'
=>
[
[
'view_type'
=>
'checkbox'
,
'is_checked'
=>
0
,
'checked_text'
=>
'反选'
,
'not_checked_text'
=>
'全选'
,
'align'
=>
'center'
,
'width'
=>
80
,
],
[
'label'
=>
'包名'
,
'view_type'
=>
'field'
,
'view_key'
=>
'name'
,
],
[
'label'
=>
'大小'
,
'view_type'
=>
'field'
,
'view_key'
=>
'size'
,
],
[
'label'
=>
'下载地址'
,
'view_type'
=>
'field'
,
'view_key'
=>
'url'
,
'grid_size'
=>
'auto'
,
],
[
'label'
=>
'创建时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'time'
,
],
[
'label'
=>
'操作'
,
'view_type'
=>
'operate'
,
'view_key'
=>
'appminialipaylist/module/operate'
,
'align'
=>
'center'
,
'fixed'
=>
'right'
,
],
],
];
}
}
?>
\ No newline at end of file
application/admin/form/Appminibaidulist.php
已删除
100644 → 0
浏览文件 @
dd0a77e8
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\admin\form
;
/**
* 百度小程序管理动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-22
* @desc description
*/
class
Appminibaidulist
{
// 基础条件
public
$condition_base
=
[];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-22
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Run
(
$params
=
[])
{
return
[
// 基础配置
'base'
=>
[
'key_field'
=>
'name'
,
'is_delete'
=>
1
,
'delete_url'
=>
MyUrl
(
'admin/appminibaidulist/delete'
),
'delete_key'
=>
'ids'
,
],
// 表单配置
'form'
=>
[
[
'view_type'
=>
'checkbox'
,
'is_checked'
=>
0
,
'checked_text'
=>
'反选'
,
'not_checked_text'
=>
'全选'
,
'align'
=>
'center'
,
'width'
=>
80
,
],
[
'label'
=>
'包名'
,
'view_type'
=>
'field'
,
'view_key'
=>
'name'
,
],
[
'label'
=>
'大小'
,
'view_type'
=>
'field'
,
'view_key'
=>
'size'
,
],
[
'label'
=>
'下载地址'
,
'view_type'
=>
'field'
,
'view_key'
=>
'url'
,
'grid_size'
=>
'auto'
,
],
[
'label'
=>
'创建时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'time'
,
],
[
'label'
=>
'操作'
,
'view_type'
=>
'operate'
,
'view_key'
=>
'appminibaidulist/module/operate'
,
'align'
=>
'center'
,
'fixed'
=>
'right'
,
],
],
];
}
}
?>
\ No newline at end of file
application/admin/form/Appminiqqlist.php
已删除
100644 → 0
浏览文件 @
dd0a77e8
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\admin\form
;
/**
* QQ小程序管理动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-22
* @desc description
*/
class
Appminiqqlist
{
// 基础条件
public
$condition_base
=
[];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-22
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Run
(
$params
=
[])
{
return
[
// 基础配置
'base'
=>
[
'key_field'
=>
'name'
,
'is_delete'
=>
1
,
'delete_url'
=>
MyUrl
(
'admin/appminiqqlist/delete'
),
'delete_key'
=>
'ids'
,
],
// 表单配置
'form'
=>
[
[
'view_type'
=>
'checkbox'
,
'is_checked'
=>
0
,
'checked_text'
=>
'反选'
,
'not_checked_text'
=>
'全选'
,
'align'
=>
'center'
,
'width'
=>
80
,
],
[
'label'
=>
'包名'
,
'view_type'
=>
'field'
,
'view_key'
=>
'name'
,
],
[
'label'
=>
'大小'
,
'view_type'
=>
'field'
,
'view_key'
=>
'size'
,
],
[
'label'
=>
'下载地址'
,
'view_type'
=>
'field'
,
'view_key'
=>
'url'
,
'grid_size'
=>
'auto'
,
],
[
'label'
=>
'创建时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'time'
,
],
[
'label'
=>
'操作'
,
'view_type'
=>
'operate'
,
'view_key'
=>
'appminiqqlist/module/operate'
,
'align'
=>
'center'
,
'fixed'
=>
'right'
,
],
],
];
}
}
?>
\ No newline at end of file
application/admin/form/Appminitoutiaolist.php
已删除
100644 → 0
浏览文件 @
dd0a77e8
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\admin\form
;
/**
* 头条小程序管理动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-22
* @desc description
*/
class
Appminitoutiaolist
{
// 基础条件
public
$condition_base
=
[];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-22
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Run
(
$params
=
[])
{
return
[
// 基础配置
'base'
=>
[
'key_field'
=>
'name'
,
'is_delete'
=>
1
,
'delete_url'
=>
MyUrl
(
'admin/appminitoutiaolist/delete'
),
'delete_key'
=>
'ids'
,
],
// 表单配置
'form'
=>
[
[
'view_type'
=>
'checkbox'
,
'is_checked'
=>
0
,
'checked_text'
=>
'反选'
,
'not_checked_text'
=>
'全选'
,
'align'
=>
'center'
,
'width'
=>
80
,
],
[
'label'
=>
'包名'
,
'view_type'
=>
'field'
,
'view_key'
=>
'name'
,
],
[
'label'
=>
'大小'
,
'view_type'
=>
'field'
,
'view_key'
=>
'size'
,
],
[
'label'
=>
'下载地址'
,
'view_type'
=>
'field'
,
'view_key'
=>
'url'
,
'grid_size'
=>
'auto'
,
],
[
'label'
=>
'创建时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'time'
,
],
[
'label'
=>
'操作'
,
'view_type'
=>
'operate'
,
'view_key'
=>
'appminitoutiaolist/module/operate'
,
'align'
=>
'center'
,
'fixed'
=>
'right'
,
],
],
];
}
}
?>
\ No newline at end of file
application/admin/form/Appminiweixinlist.php
已删除
100644 → 0
浏览文件 @
dd0a77e8
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\admin\form
;
/**
* 微信小程序管理动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-22
* @desc description
*/
class
Appminiweixinlist
{
// 基础条件
public
$condition_base
=
[];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-22
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Run
(
$params
=
[])
{
return
[
// 基础配置
'base'
=>
[
'key_field'
=>
'name'
,
'is_delete'
=>
1
,
'delete_url'
=>
MyUrl
(
'admin/appminiweixinlist/delete'
),
'delete_key'
=>
'ids'
,
],
// 表单配置
'form'
=>
[
[
'view_type'
=>
'checkbox'
,
'is_checked'
=>
0
,
'checked_text'
=>
'反选'
,
'not_checked_text'
=>
'全选'
,
'align'
=>
'center'
,
'width'
=>
80
,
],
[
'label'
=>
'包名'
,
'view_type'
=>
'field'
,
'view_key'
=>
'name'
,
],
[
'label'
=>
'大小'
,
'view_type'
=>
'field'
,
'view_key'
=>
'size'
,
],
[
'label'
=>
'下载地址'
,
'view_type'
=>
'field'
,
'view_key'
=>
'url'
,
'grid_size'
=>
'auto'
,
],
[
'label'
=>
'创建时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'time'
,
],
[
'label'
=>
'操作'
,
'view_type'
=>
'operate'
,
'view_key'
=>
'appminiweixinlist/module/operate'
,
'align'
=>
'center'
,
'fixed'
=>
'right'
,
],
],
];
}
}
?>
\ No newline at end of file
application/admin/form/Customview.php
浏览文件 @
02da718a
...
...
@@ -18,7 +18,7 @@ namespace app\admin\form;
* @date 2020-06-16
* @desc description
*/
class
Custom
V
iew
class
Custom
v
iew
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Goodsbrowse.php
浏览文件 @
02da718a
...
...
@@ -20,7 +20,7 @@ use think\Db;
* @date 2020-06-30
* @desc description
*/
class
Goods
B
rowse
class
Goods
b
rowse
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Goodsfavor.php
浏览文件 @
02da718a
...
...
@@ -20,7 +20,7 @@ use think\Db;
* @date 2020-06-30
* @desc description
*/
class
Goods
F
avor
class
Goods
f
avor
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/view/default/warehouse/module/operate.html
浏览文件 @
02da718a
...
...
@@ -3,7 +3,7 @@
<i
class=
"am-icon-eye"
></i>
<span>
详情
</span>
</button>
<a
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-btn-block"
href=
"{{:MyUrl('admin/warehouse/saveinfo', ['
w
id'=>$module_data['id']])}}"
>
<a
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-btn-block"
href=
"{{:MyUrl('admin/warehouse/saveinfo', ['id'=>$module_data['id']])}}"
>
<i
class=
"am-icon-edit"
></i>
<span>
编辑
</span>
</a>
...
...
application/admin/view/default/warehouse/save_info.html
浏览文件 @
02da718a
...
...
@@ -40,7 +40,7 @@
<input
type=
"hidden"
name=
"lat"
id=
"form-lat"
{{
if
!
empty
($
data
)}}
value=
"{{$data.lat}}"
{{/
if
}}
/>
<input
type=
"text"
name=
"address"
id=
"form-address"
placeholder=
"详细地址"
minlength=
"2"
maxlength=
"80"
data-validation-message=
"详细地址格式 1~80 个字符之间"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.address}}"
{{/
if
}}
required
/>
<span
class=
"am-input-group-btn"
>
<button
class=
"am-btn am-btn-default am-radius"
type=
"button"
id=
"map-location-submit"
><span
class=
"am-icon-map-marker"
></span>
定位
</button>
<button
type=
"button"
class=
"am-btn am-btn-default am-radius"
type=
"button"
id=
"map-location-submit"
><span
class=
"am-icon-map-marker"
></span>
定位
</button>
</span>
</div>
<div
id=
"map"
data-level=
"17"
class=
"am-margin-top-xs"
></div>
...
...
application/index/view/default/useraddress/save_info.html
浏览文件 @
02da718a
...
...
@@ -5,23 +5,23 @@
<!-- form start -->
<form
class=
"am-form form-validation"
method=
"post"
action=
"{{:MyUrl('index/useraddress/save')}}"
request-type=
"ajax-fun"
request-value=
"ViewModalBack"
>
<div
class=
"am-form-group"
>
<label>
姓名
</label>
<label>
姓名
<
span
class=
"am-form-group-label-tips-must"
>
必填
</span><
/label>
<input
type=
"text"
name=
"name"
placeholder=
"姓名"
minlength=
"2"
maxlength=
"16"
data-validation-message=
"姓名格式 2~16 个字符之间"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.name}}"
{{/
if
}}
required
/>
</div>
<div
class=
"am-form-group"
>
<label>
电话
</label>
<label>
电话
<
span
class=
"am-form-group-label-tips-must"
>
必填
</span><
/label>
<input
type=
"text"
name=
"tel"
placeholder=
"电话"
minlength=
"6"
maxlength=
"30"
data-validation-message=
"电话格式有误"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.tel}}"
{{/
if
}}
required
/>
</div>
{{include file="lib/region_linkage" /}}
<div
class=
"am-form-group"
>
<label>
详细地址
</label>
<label>
详细地址
<
span
class=
"am-form-group-label-tips-must"
>
必填
</span><
/label>
<div
class=
"am-input-group am-input-group-sm"
>
<input
type=
"hidden"
name=
"lng"
id=
"form-lng"
{{
if
!
empty
($
data
)}}
value=
"{{$data.lng}}"
{{/
if
}}
/>
<input
type=
"hidden"
name=
"lat"
id=
"form-lat"
{{
if
!
empty
($
data
)}}
value=
"{{$data.lat}}"
{{/
if
}}
/>
<input
type=
"text"
name=
"address"
id=
"form-address"
placeholder=
"详细地址"
minlength=
"2"
maxlength=
"80"
data-validation-message=
"详细地址格式 1~80 个字符之间"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.address}}"
{{/
if
}}
required
/>
<span
class=
"am-input-group-btn"
>
<button
class=
"am-btn am-btn-default am-radius"
type=
"button"
id=
"map-location-submit"
><span
class=
"am-icon-map-marker"
></span>
定位
</button>
<button
type=
"button"
class=
"am-btn am-btn-default am-radius"
type=
"button"
id=
"map-location-submit"
><span
class=
"am-icon-map-marker"
></span>
定位
</button>
</span>
</div>
<div
id=
"map"
data-level=
"17"
class=
"am-margin-top-xs"
></div>
...
...
@@ -29,7 +29,7 @@
<div
class=
"am-form-group"
>
<label>
别名
</label>
<label>
别名
<
span
class=
"am-form-group-label-tips"
>
选填
</span><
/label>
<input
type=
"text"
name=
"alias"
placeholder=
"别名"
minlength=
"0"
maxlength=
"16"
data-validation-message=
"别名格式最多 16 个字符"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.alias}}"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group"
>
...
...
application/service/GoodsService.php
浏览文件 @
02da718a
...
...
@@ -1375,7 +1375,7 @@ class GoodsService
}
// 获取仓库规格库存
$temp_data
[
'inventory'
]
=
WarehouseGoodsService
::
GoodsSpecInventory
(
$goods_id
);
$temp_data
[
'inventory'
]
=
WarehouseGoodsService
::
Warehouse
GoodsSpecInventory
(
$goods_id
);
// 规格基础添加
if
(
Db
::
name
(
'GoodsSpecBase'
)
->
insertGetId
(
$temp_data
)
<=
0
)
...
...
application/service/WarehouseGoodsService.php
浏览文件 @
02da718a
...
...
@@ -11,7 +11,6 @@
namespace
app\service
;
use
think\Db
;
use
think\facade\Hook
;
use
app\service\ResourcesService
;
use
app\service\GoodsService
;
use
app\service\UserService
;
...
...
@@ -346,7 +345,7 @@ class WarehouseGoodsService
if
(
!
empty
(
$result
[
'data'
])
&&
is_array
(
$result
[
'data'
]))
{
// 获取仓库商品
$warehouse_goods_ids
=
Db
::
name
(
'WarehouseGoods'
)
->
where
([
'goods_id'
=>
array_column
(
$result
[
'data'
],
'id'
)])
->
column
(
'goods_id'
);
$warehouse_goods_ids
=
Db
::
name
(
'WarehouseGoods'
)
->
where
([
'
warehouse_id'
=>
intval
(
$params
[
'warehouse_id'
]),
'
goods_id'
=>
array_column
(
$result
[
'data'
],
'id'
)])
->
column
(
'goods_id'
);
if
(
!
empty
(
$warehouse_goods_ids
))
{
foreach
(
$result
[
'data'
]
as
&
$v
)
...
...
@@ -748,7 +747,7 @@ class WarehouseGoodsService
// 商品规格库存
foreach
(
$res
[
'value'
]
as
$v
)
{
$inventory
=
self
::
GoodsSpecInventory
(
$goods_id
,
str_replace
(
','
,
''
,
$v
[
'value'
]));
$inventory
=
self
::
Warehouse
GoodsSpecInventory
(
$goods_id
,
str_replace
(
','
,
''
,
$v
[
'value'
]));
if
(
Db
::
name
(
'GoodsSpecBase'
)
->
where
([
'id'
=>
$v
[
'base_id'
],
'goods_id'
=>
$goods_id
])
->
update
([
'inventory'
=>
$inventory
])
===
false
)
{
...
...
@@ -780,7 +779,7 @@ class WarehouseGoodsService
* @param [int] $goods_id [商品id]
* @param [string] $spec_str [规格值,如 套餐一白色16G(无则 default)]
*/
public
static
function
GoodsSpecInventory
(
$goods_id
,
$spec_str
=
'default'
)
public
static
function
Warehouse
GoodsSpecInventory
(
$goods_id
,
$spec_str
=
'default'
)
{
// 获取商品仓库
// 仓库商品是否有效
...
...
@@ -790,17 +789,18 @@ class WarehouseGoodsService
return
0
;
}
// 无规格则使用 default 默认
if
(
empty
(
$spec_str
))
// 检查仓库是否启用
$warehouse_ids
=
Db
::
name
(
'Warehouse'
)
->
where
([
'id'
=>
$warehouse_ids
,
'is_enable'
=>
1
,
'is_delete_time'
=>
0
])
->
column
(
'id'
);
if
(
empty
(
$warehouse_ids
))
{
$spec_str
=
'default'
;
return
0
;
}
// 获取商品规格库存
$where
=
[
'warehouse_id'
=>
$warehouse_ids
,
'goods_id'
=>
$goods_id
,
'md5_key'
=>
md5
(
$spec_str
),
'md5_key'
=>
md5
(
empty
(
$spec_str
)
?
'default'
:
$spec_str
),
];
return
(
int
)
Db
::
name
(
'WarehouseGoodsSpec'
)
->
where
(
$where
)
->
sum
(
'inventory'
);
}
...
...
application/service/WarehouseService.php
浏览文件 @
02da718a
...
...
@@ -11,8 +11,8 @@
namespace
app\service
;
use
think\Db
;
use
think\facade\Hook
;
use
app\service\RegionService
;
use
app\service\WarehouseGoodsService
;
/**
* 仓库服务层
...
...
@@ -203,12 +203,28 @@ class WarehouseService
$params
[
'ids'
]
=
explode
(
','
,
$params
[
'ids'
]);
}
// 启动事务
Db
::
startTrans
();
// 删除操作
if
(
Db
::
name
(
'Warehouse'
)
->
where
([
'id'
=>
$params
[
'ids'
]])
->
delete
())
if
(
Db
::
name
(
'Warehouse'
)
->
where
([
'id'
=>
$params
[
'ids'
]])
->
update
([
'is_delete_time'
=>
time
(),
'upd_time'
=>
time
()]))
{
foreach
(
$params
[
'ids'
]
as
$warehouse_id
)
{
$ret
=
self
::
WarehouseGoodsInventorySync
(
$warehouse_id
);
if
(
$ret
[
'code'
]
!=
0
)
{
Db
::
rollback
();
return
$ret
;
}
}
// 提交事务
Db
::
commit
();
return
DataReturn
(
'删除成功'
);
}
Db
::
rollback
();
return
DataReturn
(
'删除失败'
,
-
100
);
}
...
...
@@ -248,12 +264,58 @@ class WarehouseService
return
DataReturn
(
$ret
,
-
1
);
}
// 启动事务
Db
::
startTrans
();
// 数据更新
if
(
Db
::
name
(
'Warehouse'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])])
->
update
([
$params
[
'field'
]
=>
intval
(
$params
[
'state'
]),
'upd_time'
=>
time
()]))
{
// 状态更新
if
(
$params
[
'field'
]
==
'is_enable'
)
{
$ret
=
self
::
WarehouseGoodsInventorySync
(
intval
(
$params
[
'id'
]));
if
(
$ret
[
'code'
]
!=
0
)
{
Db
::
rollback
();
return
$ret
;
}
}
// 提交事务
Db
::
commit
();
return
DataReturn
(
'编辑成功'
);
}
Db
::
rollback
();
return
DataReturn
(
'编辑失败'
,
-
100
);
}
/**
* 仓库商品库存同步
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-17
* @desc description
* @param [int] $warehouse_id [仓库id]
*/
public
static
function
WarehouseGoodsInventorySync
(
$warehouse_id
)
{
// 获取仓库商品
$goods_ids
=
Db
::
name
(
'WarehouseGoods'
)
->
where
([
'warehouse_id'
=>
$warehouse_id
])
->
column
(
'goods_id'
);
if
(
!
empty
(
$goods_ids
))
{
// 同步商品库存
foreach
(
$goods_ids
as
$goods_id
)
{
$ret
=
WarehouseGoodsService
::
GoodsSpecInventorySync
(
$goods_id
);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
}
}
return
DataReturn
(
'处理成功'
,
0
);
}
}
?>
\ No newline at end of file
changelog.txt
浏览文件 @
02da718a
...
...
@@ -5,7 +5,9 @@
1. 积分支持按照订单商品总额比例发放,发生售后收回积分
2. 微信小程序好物推荐和直播组件支持配置组件版本号
3. 支持商品自定义销售类型(销售模式、展示模式、自提模式、虚拟销售模式、销售+自提模式)
4. 商品管理去除库存的配置,移动到独立库存中管理
5. 新增仓库管理,仓库商品库存管理(多仓库、多库存)
6. 新增 Ipay88 支付方式
web端
1. 所有条件、数据列表、新增、编辑、删除 新增钩子(公共 form 表单封装)
...
...
@@ -17,11 +19,13 @@ web端
7. 支付插件管理优化适配平台,编辑不可超出插件定义的适配平台
8. 用户积分实时获取
9. 管理员新增状态
10. 后台左侧菜单优化,更简洁方便,小程序管理集合
小程序端
1. 支持商品自定义销售类型模式
插件
1. 分销插件新增返积分模块
...
...
config/shopxo.sql
浏览文件 @
02da718a
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录