Commit c93a1f4c by 杨树贤

修复冲突

parents 5726a218 3f2dce8a
...@@ -196,9 +196,9 @@ class SkuApiController extends Controller ...@@ -196,9 +196,9 @@ class SkuApiController extends Controller
if (!$setType) { if (!$setType) {
$this->response(-1, '请选择设置类型'); $this->response(-1, '请选择设置类型');
} }
if ($setType == 1 && empty($supplierGroup)) { // if ($setType == 1 && empty($supplierGroup)) {
$this->response(-1, '批量设置必须选择对应的供应商性质'); // $this->response(-1, '批量设置必须选择对应的供应商性质');
} // }
if ($setType == 2 && empty($supplierCode)) { if ($setType == 2 && empty($supplierCode)) {
$this->response(-2, '单个设置必须选择对应的供应商编码'); $this->response(-2, '单个设置必须选择对应的供应商编码');
} }
......
...@@ -365,9 +365,11 @@ class SupplierFilter ...@@ -365,9 +365,11 @@ class SupplierFilter
$query->where('stockup_type', 'NOT LIKE', '%5%')->where('sku_num', '>', 0); $query->where('stockup_type', 'NOT LIKE', '%5%')->where('sku_num', '>', 0);
break; break;
case "not_yunxin_expired": case "not_yunxin_expired":
case "not_yunxin_and_has_no_sku":
$query->where('stockup_type', 'NOT LIKE', '%5%')->where('sku_num', 0); $query->where('stockup_type', 'NOT LIKE', '%5%')->where('sku_num', 0);
break; break;
case "not_yunxin_and_has_no_sku":
$query->where('stockup_type', 'NOT LIKE', '%5%')->where('sku_num', 0)->where('uploaded_sku',1);
break;
case "yunxin": case "yunxin":
$query->where('stockup_type', 'LIKE', '%5%'); $query->where('stockup_type', 'LIKE', '%5%');
break; break;
...@@ -375,9 +377,11 @@ class SupplierFilter ...@@ -375,9 +377,11 @@ class SupplierFilter
$query->where('stockup_type', 'LIKE', '%5%')->where('sku_num', '>', 0); $query->where('stockup_type', 'LIKE', '%5%')->where('sku_num', '>', 0);
break; break;
case "yunxin_expired": case "yunxin_expired":
case "yunxin_and_has_no_sku":
$query->where('stockup_type', 'LIKE', '%5%')->where('sku_num', 0); $query->where('stockup_type', 'LIKE', '%5%')->where('sku_num', 0);
break; break;
case "yunxin_and_has_no_sku":
$query->where('stockup_type', 'LIKE', '%5%')->where('sku_num', 0)->where('uploaded_sku',1);
break;
case "yunxin_expired_at_days": case "yunxin_expired_at_days":
$query->where('stockup_type', 'LIKE', '%5%')->where('sku_expired_in_days', '!=', 0); $query->where('stockup_type', 'LIKE', '%5%')->where('sku_expired_in_days', '!=', 0);
break; break;
......
...@@ -1244,12 +1244,19 @@ class DataService ...@@ -1244,12 +1244,19 @@ class DataService
$dataManagerSupplierCodeList = DataManageModel::where('is_type', 0)->where('canal', '!=', '')->pluck('canal')->toArray(); $dataManagerSupplierCodeList = DataManageModel::where('is_type', 0)->where('canal', '!=', '')->pluck('canal')->toArray();
//sku上架总数含api接口 //sku上架总数含api接口
$skuNum1 = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->sum('sku_num'); $skuNum1 = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->sum('sku_num');
//sku上架总数,不含api接口 //sku上架总数,不含api接口
$skuNum2 = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->whereNotIn('supplier_code', $dataManagerSupplierCodeList)->sum('sku_num'); $skuNum2 = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->whereNotIn('supplier_code', $dataManagerSupplierCodeList)->sum('sku_num');
//有上架sku的供应商 //有上架sku的供应商
$supplierCount = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->where('sku_num', '>', 0)->count(); $supplierCount = SupplierChannelModel::where('is_type', 0)->where('supplier_group', '!=', 4)->whereNotIn('supplier_name', config('field.SkipChangeSupplierTypeNames'))->where('sku_num', '>', 0)->count();
$yunxinSupplierCodes = SupplierChannelModel::where('is_type', 0)->where('stockup_type', 'like', '%5%')->where('sku_num', '>', 0)->pluck('supplier_code');
//找出哪些是云芯上传的
$yunxinUploadSupplierCodes = SkuUploadLogModel::whereIn('supplier_code',$yunxinSupplierCodes)->where('source',2)->pluck('supplier_code')->unique()->toArray();
$skuNumYunxin = SupplierChannelModel::whereIn('supplier_code',$yunxinUploadSupplierCodes)->sum('sku_num');
dump("上架供应商数(不含代购,原厂):" . $supplierCount); dump("上架供应商数(不含代购,原厂):" . $supplierCount);
dump("上架云芯供应商数:" . count($yunxinUploadSupplierCodes));
dump("SKU 上架总条数(含API接口):" . $skuNum1); dump("SKU 上架总条数(含API接口):" . $skuNum1);
dump("SKU上架总条数(只含云芯):" . $skuNumYunxin);
dump("SKU 上架条数(不含API接口):" . $skuNum2); dump("SKU 上架条数(不含API接口):" . $skuNum2);
} }
......
...@@ -13,9 +13,7 @@ ...@@ -13,9 +13,7 @@
use App\Http\Services\DepartmentService; use App\Http\Services\DepartmentService;
use App\Http\Services\MessageService;
use App\Http\Services\SkuService; use App\Http\Services\SkuService;
use App\Model\SupplierChannelModel;
Route::group(['middleware' => ['web', 'menu']], function () { Route::group(['middleware' => ['web', 'menu']], function () {
Route::get('/', 'WebController@Entrance'); Route::get('/', 'WebController@Entrance');
...@@ -69,13 +67,12 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function () ...@@ -69,13 +67,12 @@ 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())->initialMainBrandsLimit(); // (new \App\Http\Services\DataService())->initialMainBrandsLimit();
// (new \App\Http\Services\DataService())->initialMainBrandsToSkuRuler(); // (new \App\Http\Services\DataService())->initialMainBrandsToSkuRuler();
// \App\Model\SupplierChannelModel::where('supplier_name', '深圳市金开盛电子有限公司')->update([ \App\Model\SupplierChannelModel::where('supplier_code', 'L0010173')->update([
// 'status' => 2, 'stockup_type' => '',
// 'update_time' => time(), ]);
// ]);
// \App\Model\SupplierChannelModel::where('supplier_name', '厦门市三安集成电路有限公司')->update([ // \App\Model\SupplierChannelModel::where('supplier_name', '厦门市三安集成电路有限公司')->update([
// 'status' => 2, // 'status' => 2,
// 'update_time' => time(), // 'update_time' => time(),
......
...@@ -3,7 +3,10 @@ ...@@ -3,7 +3,10 @@
namespace App\Providers; namespace App\Providers;
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Database\Events\QueryExecuted;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class EventServiceProvider extends ServiceProvider class EventServiceProvider extends ServiceProvider
{ {
...@@ -28,6 +31,35 @@ class EventServiceProvider extends ServiceProvider ...@@ -28,6 +31,35 @@ class EventServiceProvider extends ServiceProvider
{ {
parent::boot($events); parent::boot($events);
// //监听laravel框架执行的sql语句 并记录到log日志文件中
// DB::listen(function(QueryExecuted $event){
//
// $sql = $event->sql; //执行的sql语句
// $bindings = $event->bindings; //sql语句对应绑定的sql值
// $time = $event->time; //sql执行的时间
//
// $bindings = array_map(function($binding){
// if(is_string($binding))
// {
// return "'$binding'"; //如果$binding是字符串类型 则要将$binding的左右两边拼接上'' 即 字符串=》 '字符串'
// }
// else if($binding instanceof \DateTime)
// {
// return $binding->format("'Y-m-d H:i:s'"); //如果$binding是一个DateTime对象 则格式化时间 并在左右俩边拼接上''
// }
// else
// {
// return $binding; //直接返回$binding原本的值
// }
// }, $bindings);
//
// $sql = str_replace('?', '%s', $sql); //将sql语句中的?换成%s
//// $sql = sprintf($sql, ...$bindings); //将$bindings数组中的每一个元素替换掉$sql中的%s的位置
//
// Log::info("sql_log", ["sql" => $sql, "execute_time" => $time]); //将最终生成的sql语句写入到log日志文件中
//
// });
// //
} }
} }
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<li @if (!checkPerm('UpdateSkuRuler')) style="display: none" @endif id="ruler">SKU概况</li> <li @if (!checkPerm('UpdateSkuRuler')) style="display: none" @endif id="ruler">SKU概况</li>
<li @if (!checkPerm('ViewSupplierExamination')) style="display: none" @endif <li @if (!checkPerm('ViewSupplierExamination')) style="display: none" @endif
@if(request()->get('tab')=='examination') @if(request()->get('tab')=='examination')
class="layui-this" class="layui-this"
@endif @endif
id="examination">检测记录 id="examination">检测记录
</li> </li>
...@@ -162,7 +162,8 @@ ...@@ -162,7 +162,8 @@
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md2"> <div class="layui-col-md2">
<span class="required_field">*</span> 法人代表 :{{$supplier['legal_representative']}} <span class="required_field">*</span> 法人代表
:{{$supplier['legal_representative']}}
</div> </div>
<div class="layui-col-md3"> <div class="layui-col-md3">
法人身份证 : 法人身份证 :
...@@ -177,13 +178,15 @@ ...@@ -177,13 +178,15 @@
</div> </div>
<div class="layui-row"> <div class="layui-row">
<span class="required_field">*</span> 主营品牌 :{{$supplier['main_brand_names']}} <span class="required_field">*</span> 主营品牌 :{{$supplier['main_brand_names']}}
<div style="margin-left: 50px"> <div style="">
主营品牌数量 :{{$supplier['main_brands_limit']}} 主营品牌数量
:{{$supplier['main_brands_limit']!=-1?$supplier['main_brands_limit']:'无限制'}}
</div> </div>
</div> </div>
@if($supplier['supplier_group'] == \App\Model\SupplierChannelModel::SUPPLIER_GROUP_MIX) @if($supplier['supplier_group'] == \App\Model\SupplierChannelModel::SUPPLIER_GROUP_MIX)
<div class="layui-row"> <div class="layui-row">
<span class="required_field">*</span> 代理品牌 :{{!empty($supplier['agency_brand_names'])?$supplier['agency_brand_names']:''}} <span class="required_field">*</span> 代理品牌
:{{!empty($supplier['agency_brand_names'])?$supplier['agency_brand_names']:''}}
</div> </div>
@endif @endif
<div class="layui-row"> <div class="layui-row">
...@@ -337,7 +340,7 @@ ...@@ -337,7 +340,7 @@
<div class="layui-tab-item"> <div class="layui-tab-item">
<div <div
@if(!checkPerm('ViewRuler')) @if(!checkPerm('ViewRuler'))
style="display: none" style="display: none"
@endif @endif
> >
<div class="layui-row" style="padding-bottom: 10px"> <div class="layui-row" style="padding-bottom: 10px">
...@@ -373,7 +376,8 @@ ...@@ -373,7 +376,8 @@
</blockquote> </blockquote>
<div class="layui-row" style="margin-bottom: 10px"> <div class="layui-row" style="margin-bottom: 10px">
@if($supplier['cn_delivery_time']) @if($supplier['cn_delivery_time'])
大陆交期 : {{$supplier['cn_delivery_time'] .' '. $supplier['cn_delivery_time_period']}} , 大陆交期 : {{$supplier['cn_delivery_time'] .' '. $supplier['cn_delivery_time_period']}}
,
@else @else
大陆交期未设置 大陆交期未设置
@endif @endif
...@@ -418,7 +422,7 @@ ...@@ -418,7 +422,7 @@
<input type="checkbox" name="sku_upload_ruler[{{$key}}]" <input type="checkbox" name="sku_upload_ruler[{{$key}}]"
lay-skin="primary" lay-skin="primary"
@if($flag) @if($flag)
checked checked
@endif @endif
disabled disabled
title="{{array_get(config('fixed.SkuUploadRuler'),$key)}}"> title="{{array_get(config('fixed.SkuUploadRuler'),$key)}}">
...@@ -465,7 +469,7 @@ ...@@ -465,7 +469,7 @@
class="audit_ruler_item" class="audit_ruler_item"
disabled disabled
@if($flag) @if($flag)
checked checked
@endif @endif
title="{{array_get(config('fixed.SkuAuditRuler.name_map'),$key)}}"> title="{{array_get(config('fixed.SkuAuditRuler.name_map'),$key)}}">
@endif @endif
......
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