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
8fa1cfa0
authored
May 24, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
查看就数据
parent
d4aa445f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
1 deletions
app/Http/Services/DataService.php
app/Http/routes.php
app/Model/Purchase/StockInItemModel.php
app/Model/Purchase/StockInModel.php
app/Http/Services/DataService.php
View file @
8fa1cfa0
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
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
;
...
@@ -10,6 +11,7 @@ use App\Model\DepartmentModel;
...
@@ -10,6 +11,7 @@ use App\Model\DepartmentModel;
use
App\Model\IntracodeModel
;
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\RedisModel
;
use
App\Model\RedisModel
;
use
App\Model\SkuUploadLogModel
;
use
App\Model\SkuUploadLogModel
;
use
App\Model\StandardBrandModel
;
use
App\Model\StandardBrandModel
;
...
@@ -1208,4 +1210,19 @@ class DataService
...
@@ -1208,4 +1210,19 @@ class DataService
dump
(
"SKU 上架总条数(含API接口):"
.
$skuNum1
);
dump
(
"SKU 上架总条数(含API接口):"
.
$skuNum1
);
dump
(
"SKU 上架条数(不含API接口):"
.
$skuNum2
);
dump
(
"SKU 上架条数(不含API接口):"
.
$skuNum2
);
}
}
//获取采购系统24号作废的深圳入库明细
public
function
getDeletedSZStockInItemList
()
{
$todayTime
=
Carbon
::
now
()
->
startOfDay
()
->
timestamp
;
$stockInItems
=
StockInItemModel
::
where
(
'create_time'
,
'>'
,
$todayTime
)
->
where
(
'item_status'
,
-
3
)
->
whereHas
(
'stock_in'
,
function
(
$q
)
{
$q
->
whereIn
(
'stock_in_type'
,
[
3
]);
})
->
get
()
->
toArray
();
foreach
(
$stockInItems
as
$stockInItem
)
{
$stockIn
=
\DB
::
connection
(
'purchase'
)
->
table
(
'stock_in'
)
->
where
(
'stock_in_id'
,
$stockInItem
[
'stock_in_id'
])
->
first
()
->
toArray
();
dump
(
$stockInItem
);
}
dd
(
array_column
(
$stockInItems
,
'stock_in_item_id'
));
}
}
}
\ No newline at end of file
app/Http/routes.php
View file @
8fa1cfa0
...
@@ -67,7 +67,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
...
@@ -67,7 +67,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
(
new
\App\Http\Services\DataService
())
->
statisticsSkuNumber
();
(
new
\App\Http\Services\DataService
())
->
getDeletedSZStockInItemList
();
// \App\Model\SupplierChannelModel::where('supplier_name', '深圳市金开盛电子有限公司')->update([
// \App\Model\SupplierChannelModel::where('supplier_name', '深圳市金开盛电子有限公司')->update([
// 'status' => 2,
// 'status' => 2,
// 'update_time' => time(),
// 'update_time' => time(),
...
...
app/Model/Purchase/StockInItemModel.php
0 → 100644
View file @
8fa1cfa0
<?php
namespace
App\Model\Purchase
;
use
Illuminate\Database\Eloquent\Model
;
class
StockInItemModel
extends
Model
{
protected
$connection
=
'purchase'
;
protected
$table
=
'stock_in_items'
;
public
$timestamps
=
false
;
//关联关系,关联到主表
public
function
stock_in
()
{
return
$this
->
belongsTo
(
StockInModel
::
class
,
'stock_in_id'
,
'stock_in_id'
);
}
}
app/Model/Purchase/StockInModel.php
0 → 100644
View file @
8fa1cfa0
<?php
namespace
App\Model\Purchase
;
use
Illuminate\Database\Eloquent\Model
;
class
StockInModel
extends
Model
{
protected
$connection
=
'purchase'
;
protected
$table
=
'stock_in'
;
public
$timestamps
=
false
;
}
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