Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b864540e
authored
May 25, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
数据修复
parent
8fa1cfa0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
app/Http/Services/DataService.php
app/Http/Services/DataService.php
View file @
b864540e
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
namespace
App\Http\Services
;
namespace
App\Http\Services
;
//后台用户相关信息服务
//后台用户相关信息服务
use
App\Http\Models\StockInModel
;
use
App\Http\Transformers\SupplierContactTransformer
;
use
App\Http\Transformers\SupplierContactTransformer
;
use
App\Http\Transformers\SupplierTransformer
;
use
App\Http\Transformers\SupplierTransformer
;
use
App\Model\BigData\DataManageModel
;
use
App\Model\BigData\DataManageModel
;
...
@@ -12,6 +11,7 @@ use App\Model\IntracodeModel;
...
@@ -12,6 +11,7 @@ use App\Model\IntracodeModel;
use
App\Model\LogModel
;
use
App\Model\LogModel
;
use
App\Model\Purchase\PurchaseOrderModel
;
use
App\Model\Purchase\PurchaseOrderModel
;
use
App\Model\Purchase\StockInItemModel
;
use
App\Model\Purchase\StockInItemModel
;
use
App\Model\Purchase\StockInModel
;
use
App\Model\RedisModel
;
use
App\Model\RedisModel
;
use
App\Model\SkuUploadLogModel
;
use
App\Model\SkuUploadLogModel
;
use
App\Model\StandardBrandModel
;
use
App\Model\StandardBrandModel
;
...
@@ -1215,14 +1215,22 @@ class DataService
...
@@ -1215,14 +1215,22 @@ class DataService
public
function
getDeletedSZStockInItemList
()
public
function
getDeletedSZStockInItemList
()
{
{
$todayTime
=
Carbon
::
now
()
->
startOfDay
()
->
timestamp
;
$todayTime
=
Carbon
::
now
()
->
startOfDay
()
->
timestamp
;
//->where('item_status',-3)
$stockInItems
=
StockInItemModel
::
where
(
'create_time'
,
'>'
,
$todayTime
)
->
where
(
'item_status'
,
-
3
)
->
whereHas
(
'stock_in'
,
function
(
$q
)
{
$stockInItems
=
StockInItemModel
::
where
(
'create_time'
,
'>'
,
$todayTime
)
->
where
(
'item_status'
,
-
3
)
->
whereHas
(
'stock_in'
,
function
(
$q
)
{
$q
->
whereIn
(
'stock_in_type'
,
[
3
]);
$q
->
whereIn
(
'stock_in_type'
,
[
3
]);
})
})
->
get
()
->
toArray
();
->
get
()
->
toArray
(
);
dd
(
count
(
$stockInItems
)
);
foreach
(
$stockInItems
as
$stockInItem
)
{
foreach
(
$stockInItems
as
$stockInItem
)
{
$stockIn
=
\DB
::
connection
(
'purchase'
)
->
table
(
'stock_in'
)
->
where
(
'stock_in_id'
,
$stockInItem
[
'stock_in_id'
])
->
first
()
->
toArray
();
$first
=
$stockInItem
[
'stock_in_item_id'
];
dump
(
$stockInItem
);
dd
(
$first
,
$stockInItem
[
'stock_in_id'
]);
StockInItemModel
::
where
(
'stock_in_item_id'
,
$first
)
->
update
([
'item_status'
=>
1
]);
StockInModel
::
where
(
'stock_in_id'
,
$stockInItem
[
'stock_in_id'
])
->
update
([
'erp_stock_in_sn'
=>
''
,
'status'
=>
1
]);
}
}
dd
(
array_column
(
$stockInItems
,
'stock_in_item_id'
));
dd
(
count
((
array_column
(
$stockInItems
,
'stock_in_item_id'
))
));
}
}
}
}
\ 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