Browse Source

Merge branch 'master' of ssh://8.134.10.79:222/Leadfyy.co/hainan

master
lemon 4 years ago
parent
commit
e04237873a
  1. 7
      app/AdminSupplier/Controllers/ProductController.php
  2. 2
      app/Http/Controllers/Api/AgentProductController.php

7
app/AdminSupplier/Controllers/ProductController.php

@ -66,7 +66,12 @@ class ProductController extends AdminController
protected function detail($id)
{
return Show::make($id, new Product(), function (Show $show) {
$show->field('id');
//不允许查看非自己的数据
if ($show->model()->supplier_id != Admin::user()->id) {
Admin::exit('数据不存在');
}
$show->field('id');
$show->field('supplier_id');
$show->field('category_id');
$show->field('title');

2
app/Http/Controllers/Api/AgentProductController.php

@ -68,7 +68,7 @@ class AgentProductController extends Controller
'product:id,type,extends',
'spec' => function($query) {
return $query->has('productSpec')->with('productSpec', function ($query) {
$query->select(['id', 'name', 'date'])->orderBy('date', 'asc');
$query->select(['id', 'name', 'date'])->where('date', '>=', date('Y-m-d'))->orderBy('date', 'asc');
});
}
])

Loading…
Cancel
Save