Commit 14aeb988 by 杨树贤

修复bug

parent ab7bac05
...@@ -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();
......
...@@ -10,7 +10,7 @@ use Illuminate\Support\Facades\DB; ...@@ -10,7 +10,7 @@ use Illuminate\Support\Facades\DB;
class BaseService class BaseService
{ {
public $logId = 1; public $orgId = 1;
public function __construct() public function __construct()
{ {
......
...@@ -15,9 +15,7 @@ class AppServiceProvider extends ServiceProvider ...@@ -15,9 +15,7 @@ class AppServiceProvider extends ServiceProvider
public function boot() public function boot()
{ {
//共享全局模板变量 //共享全局模板变量
$orgId = !empty(request()->user->org_id) ? request()->user->org_id : 1;
View::share('orgId', $orgId);
View::share('isIedge', $orgId == 1 ? false : true);
} }
/** /**
......
...@@ -98,4 +98,4 @@ ...@@ -98,4 +98,4 @@
let admin = layui.admin; let admin = layui.admin;
}); });
</script> </script>
\ No newline at end of file
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