Commit 8fa1cfa0 by 杨树贤

查看就数据

parent d4aa445f
......@@ -3,6 +3,7 @@
namespace App\Http\Services;
//后台用户相关信息服务
use App\Http\Models\StockInModel;
use App\Http\Transformers\SupplierContactTransformer;
use App\Http\Transformers\SupplierTransformer;
use App\Model\BigData\DataManageModel;
......@@ -10,6 +11,7 @@ use App\Model\DepartmentModel;
use App\Model\IntracodeModel;
use App\Model\LogModel;
use App\Model\Purchase\PurchaseOrderModel;
use App\Model\Purchase\StockInItemModel;
use App\Model\RedisModel;
use App\Model\SkuUploadLogModel;
use App\Model\StandardBrandModel;
......@@ -1208,4 +1210,19 @@ class DataService
dump("SKU 上架总条数(含API接口):".$skuNum1);
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
......@@ -67,7 +67,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], 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([
// 'status' => 2,
// 'update_time' => time(),
......
<?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');
}
}
<?php
namespace App\Model\Purchase;
use Illuminate\Database\Eloquent\Model;
class StockInModel extends Model
{
protected $connection='purchase';
protected $table='stock_in';
public $timestamps = false;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment