Commit 14aeb988 by 杨树贤

修复bug

parent ab7bac05
......@@ -47,22 +47,27 @@ class IndexController extends Controller
public function Index($request)
{
$service = new IndexService();
$statistics = $service->getDailySupplierAddStatistics();
$this->data['dates'] = array_values(array_column($statistics['all'], 'date'));
$this->data['all_increase_statistics'] = array_values(array_column($statistics['all'], 'count'));
$this->data['user_increase_statistics'] = array_values(array_column($statistics['user'], 'count'));
$intraCodeModel = new IntracodeModel();
$userCodes = $intraCodeModel->getSampleEncode();
$this->data['user'] = $userCodes;
$this->data['purchase_users'] = [];
foreach ($userCodes as $userId => $code) {
$this->data['purchase_users'][] = [
'name' => $code,
'value' => $userId,
];
try {
$statistics = $service->getDailySupplierAddStatistics();
$this->data['dates'] = array_values(array_column($statistics['all'], 'date'));
$this->data['all_increase_statistics'] = array_values(array_column($statistics['all'], 'count'));
$this->data['user_increase_statistics'] = array_values(array_column($statistics['user'], 'count'));
$intraCodeModel = new IntracodeModel();
$userCodes = $intraCodeModel->getSampleEncode();
$this->data['user'] = $userCodes;
$this->data['purchase_users'] = [];
foreach ($userCodes as $userId => $code) {
$this->data['purchase_users'][] = [
'name' => $code,
'value' => $userId,
];
}
} catch (\Exception $exception) {
}
return $this->view('首页');
}
}
\ No newline at end of file
}
......@@ -44,7 +44,9 @@ class SkuController extends Controller
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);
$this->data['skuTags'] = $skuTags;
//获取筛选框的品牌数据
......@@ -125,6 +127,9 @@ class SkuController extends Controller
//批量设置sku显示类型
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显示类型';
$suppliers = SupplierChannelModel::where('is_type', 0)->where('status', 2)
->select(['supplier_name', 'supplier_code'])->get();
......
......@@ -10,7 +10,7 @@ use Illuminate\Support\Facades\DB;
class BaseService
{
public $logId = 1;
public $orgId = 1;
public function __construct()
{
......
......@@ -15,9 +15,7 @@ class AppServiceProvider extends ServiceProvider
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 @@
let admin = layui.admin;
});
</script>
\ No newline at end of file
</script>
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