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
b173804b
Commit
b173804b
authored
Jul 15, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test'
parents
6ecea2b9
03db065e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
3 deletions
+66
-3
LifeAccountShopNum.php
application/models/goods/mysql/LifeAccountShopNum.php
+46
-0
GoodsService.php
application/services/goods/GoodsService.php
+15
-2
MarketingGoodsService.php
application/services/marketing/MarketingGoodsService.php
+1
-0
MarketingService.php
application/services/marketing/MarketingService.php
+1
-0
Goods.php
daemon/Goods.php
+3
-1
No files found.
application/models/goods/mysql/LifeAccountShopNum.php
0 → 100644
View file @
b173804b
<?php
namespace
App\Models\goods\mysql
;
use
Api\PhpUtils\Mysql\MysqlBase
;
/**
* Class LifeAccountShopNum
* 生活号下店铺的数量
* @package App\Models\goods\mysql
*/
class
LifeAccountShopNum
extends
MysqlBase
{
const
TABLE_NAME
=
'life_account_shop_num'
;
const
CONFIG_INDEX
=
'goods'
;
const
PRIMARY_KEY
=
'life_account_id'
;
public
static
function
getRecord
(
$where
,
$colums
=
[])
{
if
(
empty
(
$colums
))
{
$colums
=
'*'
;
}
return
self
::
get
(
$colums
,
$where
);
}
public
static
function
getRecordMaster
(
$where
,
$colums
=
[])
{
if
(
empty
(
$colums
))
{
$colums
=
'*'
;
}
return
self
::
selectMaster
(
$colums
,
$where
);
}
public
static
function
save
(
$data
,
$where
=
[])
{
if
(
empty
(
$where
))
{
return
self
::
insert
(
$data
);
}
return
self
::
update
(
$data
,
$where
);
}
public
static
function
deleteRecord
(
$where
)
{
return
self
::
delete
(
$where
);
}
}
\ No newline at end of file
application/services/goods/GoodsService.php
View file @
b173804b
...
...
@@ -19,6 +19,7 @@ use App\Models\goods\mysql\GoodsSkuPicRecord;
use
App\Models\goods\mysql\GoodsSkuSubShop
;
use
App\Models\goods\mysql\GoodsSnapshot
;
use
App\Models\goods\mysql\GoodsSpu
;
use
App\Models\goods\mysql\LifeAccountShopNum
;
use
App\Models\goods\mysql\PaySuccessGoodsCallbackRecord
;
use
App\Models\goods\mysql\Shop
;
use
App\Models\marketing\mysql\Distributor
;
...
...
@@ -256,6 +257,13 @@ class GoodsService
"merchant_id"
=>
$lifeAccount
[
"merchant_id"
],
"status"
=>
Shop
::
STATUS_ONLINE
,
]);
$shopNum
=
LifeAccountShopNum
::
getRecord
([
"life_account_id"
=>
$lifeAccountId
]);
if
(
empty
(
$shopNum
))
{
LifeAccountShopNum
::
save
([
"life_account_id"
=>
$lifeAccountId
,
"number"
=>
1
]);
}
else
{
LifeAccountShopNum
::
save
([
"number"
=>
$shopNum
[
"number"
]
+
1
],
[
"life_account_id"
=>
$lifeAccountId
]);
}
}
else
{
$shopId
=
$shop
[
0
][
"shop_id"
];
}
...
...
@@ -334,7 +342,7 @@ class GoodsService
throw
new
GoodsException
([
"cus"
=>
12
]);
}
//驳回时候要有原因
if
(
$status
==
GoodsSku
::
STATUS_REJECT
&&
empty
(
$params
[
"rejected_reason"
])
)
{
if
(
$status
==
GoodsSku
::
STATUS_REJECT
&&
strlen
(
trim
(
$params
[
"rejected_reason"
]))
==
0
)
{
throw
new
GoodsException
([
"cus"
=>
9
]);
}
...
...
@@ -381,6 +389,10 @@ class GoodsService
"note"
=>
$rejectedReason
,
];
GoodsOperationRecord
::
insertRecord
(
$record
);
//审核通过并且上架后,添加镜像
if
(
$status
==
GoodsSku
::
STATUS_PASS
)
{
self
::
addGoodsSnapshot
(
$sku
);
}
self
::
updateGoodsInfoToEs
(
$goodsSkuId
);
}
...
...
@@ -466,6 +478,7 @@ class GoodsService
if
(
empty
(
$skuInfo
[
"setmeal"
]))
{
$skuInfo
[
"setmeal"
]
=
json_encode
([]);
}
unset
(
$skuInfo
[
"is_import"
],
$skuInfo
[
"update_time"
],
$skuInfo
[
"create_time"
]);
GoodsSnapshot
::
insertRecord
(
$skuInfo
);
}
...
...
@@ -756,7 +769,7 @@ class GoodsService
}
}
}
$recordList
=
GoodsOperationRecord
::
select
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
$recordList
=
GoodsOperationRecord
::
select
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
,
"ORDER"
=>
[
"create_time"
=>
"DESC"
]
]);
if
(
!
empty
(
$recordList
))
{
foreach
(
$recordList
as
$key
=>
$record
)
{
$data
[
"record_list"
][
$key
][
"status"
]
=
$record
[
"goods_status"
];
...
...
application/services/marketing/MarketingGoodsService.php
View file @
b173804b
...
...
@@ -13,6 +13,7 @@ use Api\PhpServices\Ksy\Ksyun;
use
App\Exception\custom\MarketingException
;
use
App\Services\common\CommonService
;
use
Api\PhpServices\Sensitive\Sensitive
;
use
App\Services\goods\GoodsService
;
class
MarketingGoodsService
{
public
static
function
getMarketingGoodsList
(
$params
)
...
...
application/services/marketing/MarketingService.php
View file @
b173804b
...
...
@@ -72,6 +72,7 @@ class MarketingService
$where
=
[
'online_status'
=>
1
,
'rule_refund'
=>
2
,
"expiration_time[>]"
=>
date
(
"Y-m-d"
),
];
if
(
!
empty
(
$tmpGoodsSkuId
))
{
...
...
daemon/Goods.php
View file @
b173804b
...
...
@@ -6,6 +6,7 @@ namespace Daemon;
use
Api\PhpServices\Daemon\DaemonServiceInterface
;
use
App\Models\goods\mysql\GoodsSku
;
use
Api\PhpUtils\Log\FileLog
;
class
Goods
implements
DaemonServiceInterface
{
public
function
__construct
(
int
$mid
)
...
...
@@ -18,9 +19,10 @@ class Goods implements DaemonServiceInterface
sleep
(
2
);
$orderData
=
[
'online_status'
=>
1
,
'
rule_end
_time[<]'
=>
date
(
"Y-m-d H:i:s"
,
time
())
'
expiration
_time[<]'
=>
date
(
"Y-m-d H:i:s"
,
time
())
];
$goodsList
=
GoodsSku
::
getRecords
(
$orderData
);
FileLog
::
info
(
'DaemonServiceInterface_goods'
,
json_encode
(
$goodsList
));
foreach
(
$goodsList
as
$key
=>
$value
)
{
$where
=
[];
$where
[
'goods_sku_id'
]
=
!
empty
(
$value
[
'goods_sku_id'
])
?
$value
[
'goods_sku_id'
]
:
''
;
...
...
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