Commit 89d76014 by 杨树贤

Merge branch 'master' into ysx-供应商财务信息增加中转行-20241125

parents 2a1518ab 14e185fb
...@@ -154,7 +154,7 @@ MENU_ID=16 ...@@ -154,7 +154,7 @@ MENU_ID=16
MENU_URL=http://data.liexin.net/api/config/ MENU_URL=http://data.liexin.net/api/config/
FOOTSTONE_URL=http://footstone.liexindev.net FOOTSTONE_URL=http://footstone.liexindev.net
#标签系统的地址 #标签系统的地址
TAG_URL=http://192.168.1.18:32581 TAG_URL=http://192.168.1.17:32581
SKIP_SEND_EMAIL=true SKIP_SEND_EMAIL=true
......
...@@ -47,22 +47,27 @@ class IndexController extends Controller ...@@ -47,22 +47,27 @@ class IndexController extends Controller
public function Index($request) public function Index($request)
{ {
$service = new IndexService(); $service = new IndexService();
$statistics = $service->getDailySupplierAddStatistics(); try {
$this->data['dates'] = array_values(array_column($statistics['all'], 'date')); $statistics = $service->getDailySupplierAddStatistics();
$this->data['all_increase_statistics'] = array_values(array_column($statistics['all'], 'count')); $this->data['dates'] = array_values(array_column($statistics['all'], 'date'));
$this->data['user_increase_statistics'] = array_values(array_column($statistics['user'], 'count')); $this->data['all_increase_statistics'] = array_values(array_column($statistics['all'], 'count'));
$intraCodeModel = new IntracodeModel(); $this->data['user_increase_statistics'] = array_values(array_column($statistics['user'], 'count'));
$userCodes = $intraCodeModel->getSampleEncode(); $intraCodeModel = new IntracodeModel();
$this->data['user'] = $userCodes; $userCodes = $intraCodeModel->getSampleEncode();
$this->data['purchase_users'] = []; $this->data['user'] = $userCodes;
foreach ($userCodes as $userId => $code) { $this->data['purchase_users'] = [];
$this->data['purchase_users'][] = [ foreach ($userCodes as $userId => $code) {
'name' => $code, $this->data['purchase_users'][] = [
'value' => $userId, 'name' => $code,
]; 'value' => $userId,
];
}
} catch (\Exception $exception) {
} }
return $this->view('首页'); return $this->view('首页');
} }
} }
\ No newline at end of file
...@@ -44,7 +44,9 @@ class SkuController extends Controller ...@@ -44,7 +44,9 @@ class SkuController extends Controller
public function SkuList($request) public function SkuList($request)
{ {
$orgId = !empty(request()->user->org_id) ? request()->user->org_id : 1;
$this->data['isIedge'] = $orgId == 1 ? false : true;
$this->data['orgId'] = $orgId;
$skuTags = TagsModel::getTagNamesByTagUse(16, 2); $skuTags = TagsModel::getTagNamesByTagUse(16, 2);
$this->data['skuTags'] = $skuTags; $this->data['skuTags'] = $skuTags;
//获取筛选框的品牌数据 //获取筛选框的品牌数据
...@@ -125,6 +127,9 @@ class SkuController extends Controller ...@@ -125,6 +127,9 @@ class SkuController extends Controller
//批量设置sku显示类型 //批量设置sku显示类型
public function BatchUpdateGoodsLabel($request) public function BatchUpdateGoodsLabel($request)
{ {
$orgId = !empty(request()->user->org_id) ? request()->user->org_id : 1;
$this->data['isIedge'] = $orgId == 1 ? false : true;
$this->data['orgId'] = $orgId;
$this->data['title'] = '批量设置sku显示类型'; $this->data['title'] = '批量设置sku显示类型';
$suppliers = SupplierChannelModel::where('is_type', 0)->where('status', 2) $suppliers = SupplierChannelModel::where('is_type', 0)->where('status', 2)
->select(['supplier_name', 'supplier_code'])->get(); ->select(['supplier_name', 'supplier_code'])->get();
......
<?php
namespace App\Http\Services;
//后台用户相关信息服务
use App\Model\SupplierBlacklistModel;
use App\Model\SupplierChannelModel;
use Illuminate\Support\Facades\DB;
class BaseService
{
public $orgId = 1;
public function __construct()
{
$this->orgId = !empty(request()->user->org_id) ? request()->user->org_id : 1;
}
}
...@@ -16,7 +16,7 @@ use Illuminate\Support\Facades\Redis; ...@@ -16,7 +16,7 @@ use Illuminate\Support\Facades\Redis;
use PhpAmqpLib\Connection\AMQPStreamConnection; use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Message\AMQPMessage; use PhpAmqpLib\Message\AMQPMessage;
class SkuService class SkuService extends BaseService
{ {
const OPERATE_TYPE_PUTAWAY = 1; const OPERATE_TYPE_PUTAWAY = 1;
...@@ -108,7 +108,11 @@ class SkuService ...@@ -108,7 +108,11 @@ class SkuService
//获取是否精选和标签 //获取是否精选和标签
$goodsTag = $this->getGoodsTag($sku['goods_id']); $goodsTag = $this->getGoodsTag($sku['goods_id']);
$sku['goods_label'] = array_get($goodsTag, 'goods_label', ''); $sku['goods_label'] = array_get($goodsTag, 'goods_label', '');
$sku['goods_label_name'] = array_get(config('field.SkuGoodsLabel'), $sku['goods_label'], ''); if ($this->orgId == 1) {
$sku['goods_label_name'] = array_get(config('field.SkuGoodsLabel'), $sku['goods_label'], '');
}else{
$sku['goods_label_name'] = array_get(config('field.SkuGoodsLabelForIedge'), $sku['goods_label'], '');
}
$sku['tags'] = array_get($goodsTag, 'tags', []); $sku['tags'] = array_get($goodsTag, 'tags', []);
if (!empty($sku['tags'])) { if (!empty($sku['tags'])) {
$sku['is_prefer'] = in_array(1, $sku['tags']) ? 1 : 0; $sku['is_prefer'] = in_array(1, $sku['tags']) ? 1 : 0;
...@@ -136,7 +140,7 @@ class SkuService ...@@ -136,7 +140,7 @@ class SkuService
$dbInfo = getSpuSkuDb($item['goods_id']); $dbInfo = getSpuSkuDb($item['goods_id']);
$connection = DB::connection($dbInfo["db"]); $connection = DB::connection($dbInfo["db"]);
$table = $dbInfo['table']; $table = $dbInfo['table'];
$selectFields = ['goods_id', 'create_time', 'eccn', 'source', 'encoded','org_id']; $selectFields = ['goods_id', 'create_time', 'eccn', 'source', 'encoded', 'org_id'];
$skuDBData = $connection->table($table)->select($selectFields)->where('goods_id', $item['goods_id'])->first(); $skuDBData = $connection->table($table)->select($selectFields)->where('goods_id', $item['goods_id'])->first();
$skuDBData = $skuDBData ? $skuDBData : []; $skuDBData = $skuDBData ? $skuDBData : [];
$item['source_name'] = array_get(config('field.SkuSource'), @$skuDBData['source'], ''); $item['source_name'] = array_get(config('field.SkuSource'), @$skuDBData['source'], '');
...@@ -506,7 +510,7 @@ class SkuService ...@@ -506,7 +510,7 @@ class SkuService
} else { } else {
$goodsTag = [ $goodsTag = [
'goods_label' => $goodsLabel, 'goods_label' => $goodsLabel,
]; ];
} }
$redis->hset('goods_tag', $skuId, json_encode($goodsTag)); $redis->hset('goods_tag', $skuId, json_encode($goodsTag));
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace App\Providers; namespace App\Providers;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider class AppServiceProvider extends ServiceProvider
...@@ -13,7 +14,8 @@ class AppServiceProvider extends ServiceProvider ...@@ -13,7 +14,8 @@ class AppServiceProvider extends ServiceProvider
*/ */
public function boot() public function boot()
{ {
// //共享全局模板变量
} }
/** /**
......
...@@ -53,6 +53,16 @@ return [ ...@@ -53,6 +53,16 @@ return [
-1 => '代购现货' -1 => '代购现货'
], ],
'SkuGoodsLabelForIedge' => [
1 => '华云现货',
2 => '国际现货',
3 => '华云期货',
4 => '询价现货',
5 => '原厂直售',
6 => '猎芯精选',
-1 => '代购现货'
],
//SKU 标签 //SKU 标签
'SkuTag' => [ 'SkuTag' => [
1 => '优选', 1 => '优选',
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<div class="layui-form-item" style="margin-left: -50px"> <div class="layui-form-item" style="margin-left: -50px">
@inject('statusPresenter','App\Presenters\StatusPresenter') @inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('goods_label','SKU显示类型 : ',null, {!! $statusPresenter->render('goods_label','SKU显示类型 : ',null,
config('field.SkuGoodsLabel'),['required'=>true,'label_width'=>'100px']) !!} $isIedge?config('field.SkuGoodsLabelForIedge'):config('field.SkuGoodsLabel'),['required'=>true,'label_width'=>'100px']) !!}
</div> </div>
<div align="center" style="margin-top: 10px;text-align: right"> <div align="center" style="margin-top: 10px;text-align: right">
<button type="button" class="layui-btn layui-btn-sm layui-btn-info submit-loading" lay-submit <button type="button" class="layui-btn layui-btn-sm layui-btn-info submit-loading" lay-submit
......
...@@ -98,4 +98,4 @@ ...@@ -98,4 +98,4 @@
let admin = layui.admin; let admin = layui.admin;
}); });
</script> </script>
\ No newline at end of file
...@@ -79,18 +79,12 @@ ...@@ -79,18 +79,12 @@
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter') @inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('goods_label/condition','SKU显示类型','',config('field.SkuGoodsLabel')) !!} {!! $statusPresenter->render('goods_label/condition','SKU显示类型','',$isIedge?config('field.SkuGoodsLabelForIedge'):config('field.SkuGoodsLabel')) !!}
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter') @inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('tags/condition','是否精选',request()->get('tags/condition'),[1=>'是',0=>'否']) !!} {!! $statusPresenter->render('tags/condition','是否精选',request()->get('tags/condition'),[1=>'是',0=>'否']) !!}
</div> </div>
{{-- <div class="layui-inline">--}}
{{-- @inject('statusPresenter','App\Presenters\StatusPresenter')--}}
{{-- {!! $statusPresenter->render('status/condition','是否过期',request()->get('status/condition'),[0=>'是',1=>'否']) !!}--}}
{{-- </div>--}}
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">起订量库存</label> <label class="layui-form-label">起订量库存</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
......
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