Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
goods
Commits
ccf41451
Commit
ccf41451
authored
Jun 21, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:修改u_id为user_id
parent
6c8b9298
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
16 deletions
+63
-16
GoodsAddValidate.php
application/library/Validate/GoodsAddValidate.php
+2
-2
GoodsAuditValidate.php
application/library/Validate/GoodsAuditValidate.php
+0
-4
GoodsOnlineOfflineValidate.php
application/library/Validate/GoodsOnlineOfflineValidate.php
+23
-0
Goods.php
application/modules/Goods/controllers/Goods.php
+2
-1
GoodsService.php
application/services/goods/GoodsService.php
+36
-9
No files found.
application/library/Validate/GoodsAddValidate.php
View file @
ccf41451
...
@@ -22,7 +22,7 @@ class GoodsAddValidate extends BaseValidate
...
@@ -22,7 +22,7 @@ class GoodsAddValidate extends BaseValidate
'inventory_add'
=>
'require'
,
'inventory_add'
=>
'require'
,
'life_account_id'
=>
'require'
,
'life_account_id'
=>
'require'
,
'merchant_id'
=>
'require'
,
'merchant_id'
=>
'require'
,
'u_id'
=>
'require'
,
'u
ser
_id'
=>
'require'
,
];
];
protected
$message
=
[
protected
$message
=
[
...
@@ -36,6 +36,6 @@ class GoodsAddValidate extends BaseValidate
...
@@ -36,6 +36,6 @@ class GoodsAddValidate extends BaseValidate
'inventory_add'
=>
'请填写库存'
,
'inventory_add'
=>
'请填写库存'
,
'life_account_id'
=>
'life_account_id 不能为空'
,
'life_account_id'
=>
'life_account_id 不能为空'
,
'merchant_id'
=>
'merchant_id 不能为空'
,
'merchant_id'
=>
'merchant_id 不能为空'
,
'u
_id'
=>
'u
_id 不能为空'
,
'u
ser_id'
=>
'user
_id 不能为空'
,
];
];
}
}
\ No newline at end of file
application/library/Validate/GoodsAuditValidate.php
View file @
ccf41451
...
@@ -14,14 +14,10 @@ class GoodsAuditValidate extends BaseValidate
...
@@ -14,14 +14,10 @@ class GoodsAuditValidate extends BaseValidate
protected
$rule
=
[
protected
$rule
=
[
'goods_spu_id'
=>
'require'
,
'goods_spu_id'
=>
'require'
,
'status'
=>
'require'
,
'status'
=>
'require'
,
'uid'
=>
'require'
,
'username'
=>
'require'
,
];
];
protected
$message
=
[
protected
$message
=
[
"goods_spu_id"
=>
"商品id不能为空"
,
"goods_spu_id"
=>
"商品id不能为空"
,
"status"
=>
"商品审核状态不能为空"
,
"status"
=>
"商品审核状态不能为空"
,
"uid"
=>
"用户id不能为空"
,
"username"
=>
"用户username不能为空"
,
];
];
}
}
\ No newline at end of file
application/library/Validate/GoodsOnlineOfflineValidate.php
0 → 100644
View file @
ccf41451
<?php
namespace
Validate
;
/**
* Class GoodsOnlineOfflineValidate
*
* @package Validate
*/
class
GoodsOnlineOfflineValidate
extends
BaseValidate
{
protected
$rule
=
[
'goods_spu_id'
=>
'require'
,
'online_status'
=>
'require'
,
];
protected
$message
=
[
"goods_spu_id"
=>
"商品id不能为空"
,
"online_status"
=>
"商品审核状态不能为空"
,
];
}
\ No newline at end of file
application/modules/Goods/controllers/Goods.php
View file @
ccf41451
...
@@ -10,6 +10,7 @@ use \Validate\GoodsEditValidate;
...
@@ -10,6 +10,7 @@ use \Validate\GoodsEditValidate;
use
\Validate\GoodsInfoOpValidate
;
use
\Validate\GoodsInfoOpValidate
;
use
\Validate\GoodsInfoFeValidate
;
use
\Validate\GoodsInfoFeValidate
;
use
\Validate\GoodsListCValidate
;
use
\Validate\GoodsListCValidate
;
use
\Validate\GoodsOnlineOfflineValidate
;
use
\App\Services\goods\ElasticGoodService
;
use
\App\Services\goods\ElasticGoodService
;
...
@@ -79,7 +80,7 @@ class GoodsController extends Base
...
@@ -79,7 +80,7 @@ class GoodsController extends Base
*/
*/
public
function
online_offlineAction
()
public
function
online_offlineAction
()
{
{
(
new
Goods
Audit
Validate
())
->
validate
();
(
new
Goods
OnlineOffline
Validate
())
->
validate
();
$params
=
$this
->
params
;
$params
=
$this
->
params
;
GoodsService
::
onlineOrOffline
(
$params
);
GoodsService
::
onlineOrOffline
(
$params
);
...
...
application/services/goods/GoodsService.php
View file @
ccf41451
...
@@ -5,6 +5,7 @@ namespace App\Services\goods;
...
@@ -5,6 +5,7 @@ namespace App\Services\goods;
use
Api\PhpServices\Idgen\Idgen
;
use
Api\PhpServices\Idgen\Idgen
;
use
Api\PhpServices\Sensitive\Sensitive
;
use
Api\PhpUtils\Common\BaseConvert
;
use
Api\PhpUtils\Common\BaseConvert
;
use
App\Exception\custom\GoodsException
;
use
App\Exception\custom\GoodsException
;
use
App\Models\goods\mysql\Category
;
use
App\Models\goods\mysql\Category
;
...
@@ -73,7 +74,7 @@ class GoodsService
...
@@ -73,7 +74,7 @@ class GoodsService
"goods_operation_record_id"
=>
$res
[
0
],
"goods_operation_record_id"
=>
$res
[
0
],
"goods_spu_id"
=>
$spuId
,
"goods_spu_id"
=>
$spuId
,
"goods_sku_id"
=>
$skuId
,
"goods_sku_id"
=>
$skuId
,
"operator_id"
=>
$params
[
"u_id"
],
"operator_id"
=>
$params
[
"u
ser
_id"
],
"operator_name"
=>
$params
[
"user_name"
],
"operator_name"
=>
$params
[
"user_name"
],
"goods_status"
=>
GoodsSku
::
STATUS_AUDIT
,
"goods_status"
=>
GoodsSku
::
STATUS_AUDIT
,
"online_status"
=>
GoodsSku
::
ONLINE_STATUS_NO_ONLINE
,
"online_status"
=>
GoodsSku
::
ONLINE_STATUS_NO_ONLINE
,
...
@@ -112,7 +113,7 @@ class GoodsService
...
@@ -112,7 +113,7 @@ class GoodsService
"goods_spu_id"
=>
$spuId
,
"goods_spu_id"
=>
$spuId
,
"shop_id"
=>
$shopId
,
"shop_id"
=>
$shopId
,
"life_account_id"
=>
$spuData
[
"life_account_id"
],
"life_account_id"
=>
$spuData
[
"life_account_id"
],
"u
_id"
=>
$spuData
[
"u
_id"
],
"u
ser_id"
=>
$spuData
[
"user
_id"
],
"name"
=>
$spuData
[
"name"
],
"name"
=>
$spuData
[
"name"
],
"url"
=>
$spuData
[
"url"
],
"url"
=>
$spuData
[
"url"
],
"desc"
=>
$spuData
[
"desc"
],
"desc"
=>
$spuData
[
"desc"
],
...
@@ -151,7 +152,7 @@ class GoodsService
...
@@ -151,7 +152,7 @@ class GoodsService
"goods_spu_id"
=>
$spuId
,
"goods_spu_id"
=>
$spuId
,
"life_account_id"
=>
$skuData
[
"life_account_id"
],
"life_account_id"
=>
$skuData
[
"life_account_id"
],
"shop_id"
=>
$shopId
,
"shop_id"
=>
$shopId
,
"u
_id"
=>
$skuData
[
"u
_id"
],
"u
ser_id"
=>
$skuData
[
"user
_id"
],
"category_1_id"
=>
$skuData
[
"category_1_id"
],
"category_1_id"
=>
$skuData
[
"category_1_id"
],
"category_2_id"
=>
$skuData
[
"category_2_id"
],
"category_2_id"
=>
$skuData
[
"category_2_id"
],
"name"
=>
$skuData
[
"name"
],
"name"
=>
$skuData
[
"name"
],
...
@@ -216,10 +217,13 @@ class GoodsService
...
@@ -216,10 +217,13 @@ class GoodsService
{
{
$goodsSpuId
=
$params
[
"goods_spu_id"
];
$goodsSpuId
=
$params
[
"goods_spu_id"
];
$status
=
$params
[
"status"
];
$status
=
$params
[
"status"
];
$operatorId
=
$params
[
"uid"
];
$operatorId
=
$params
[
"u
ser_
id"
];
$operatorName
=
$params
[
"username"
];
$operatorName
=
$params
[
"user
_
name"
];
$goodsSpu
=
GoodsSpu
::
get
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
$goodsSpu
=
GoodsSpu
::
get
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
if
(
empty
(
$goodsSpu
))
{
throw
new
GoodsException
([
"cus"
=>
15
]);
}
//todo::权限判断 商品所属 life_account_id 或者 后台管理员
//todo::权限判断 商品所属 life_account_id 或者 后台管理员
//权限判断
//权限判断
if
(
!
empty
(
$params
[
"life_account_id"
])
&&
$goodsSpu
[
"life_account_id"
]
!=
$params
[
"life_account_id"
])
{
if
(
!
empty
(
$params
[
"life_account_id"
])
&&
$goodsSpu
[
"life_account_id"
]
!=
$params
[
"life_account_id"
])
{
...
@@ -286,8 +290,8 @@ class GoodsService
...
@@ -286,8 +290,8 @@ class GoodsService
{
{
$goodsSpuId
=
$params
[
"goods_spu_id"
];
$goodsSpuId
=
$params
[
"goods_spu_id"
];
$onlineStatus
=
$params
[
"online_status"
];
$onlineStatus
=
$params
[
"online_status"
];
$operatorId
=
$params
[
"uid"
];
$operatorId
=
$params
[
"u
ser_
id"
];
$operatorName
=
$params
[
"username"
];
$operatorName
=
$params
[
"user
_
name"
];
$goodsSpu
=
GoodsSpu
::
get
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
$goodsSpu
=
GoodsSpu
::
get
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
//todo::权限判断 商品所属 life_account_id 或者 后台管理员
//todo::权限判断 商品所属 life_account_id 或者 后台管理员
...
@@ -471,7 +475,7 @@ class GoodsService
...
@@ -471,7 +475,7 @@ class GoodsService
"goods_operation_record_id"
=>
$res
[
0
],
"goods_operation_record_id"
=>
$res
[
0
],
"goods_spu_id"
=>
$skuData
[
"goods_spu_id"
],
"goods_spu_id"
=>
$skuData
[
"goods_spu_id"
],
"goods_sku_id"
=>
$goodsSkuId
,
"goods_sku_id"
=>
$goodsSkuId
,
"operator_id"
=>
$params
[
"u_id"
],
"operator_id"
=>
$params
[
"u
ser
_id"
],
"operator_name"
=>
$params
[
"user_name"
],
"operator_name"
=>
$params
[
"user_name"
],
"goods_status"
=>
GoodsSku
::
STATUS_AUDIT
,
"goods_status"
=>
GoodsSku
::
STATUS_AUDIT
,
"online_status"
=>
GoodsSku
::
ONLINE_STATUS_NO_ONLINE
,
"online_status"
=>
GoodsSku
::
ONLINE_STATUS_NO_ONLINE
,
...
@@ -600,7 +604,7 @@ class GoodsService
...
@@ -600,7 +604,7 @@ class GoodsService
$where
[
'ORDER'
]
=
[
"create_time"
=>
"DESC"
];
$where
[
'ORDER'
]
=
[
"create_time"
=>
"DESC"
];
$list
=
GoodsSku
::
select
([
"goods_spu_id"
,
"goods_sku_id"
,
"name"
,
"category_1_id"
,
"category_2_id"
,
"life_account_id"
,
$list
=
GoodsSku
::
select
([
"goods_spu_id"
,
"goods_sku_id"
,
"name"
,
"category_1_id"
,
"category_2_id"
,
"life_account_id"
,
"u_id"
,
"update_time"
,
"create_time"
,
"status"
,
"online_status"
],
"u
ser
_id"
,
"update_time"
,
"create_time"
,
"status"
,
"online_status"
],
$where
);
$where
);
return
[
"list"
=>
$list
,
"count"
=>
$count
];
return
[
"list"
=>
$list
,
"count"
=>
$count
];
}
}
...
@@ -719,4 +723,27 @@ class GoodsService
...
@@ -719,4 +723,27 @@ class GoodsService
}
}
return
false
;
return
false
;
}
}
/**
* 敏感词检查
* $text 送查内容
* $scene 场景ID 1.标题 2.简介 3.正文 4.评论 6.昵称 7.搜索
* $businessId 1.一点 2.身边 9.VPN
* @param $text
* @param $scene
* @param int $businessId
* @return bool|mixed
* @throws \App\Exception\custom\CodeSpecialException
*/
private
function
checkSensitive
(
$text
,
$scene
,
$businessId
=
1
)
{
$params
=
[
'businessId'
=>
$businessId
,
'text'
=>
$text
,
'scene'
=>
$scene
,
];
return
(
new
Sensitive
())
->
detect
(
$params
);
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment