|
@@ -87,11 +87,11 @@ class Award extends BaseController
|
|
|
public function oil_create(OilLevelValidate $validate,OilLevelRepository $repository)
|
|
public function oil_create(OilLevelValidate $validate,OilLevelRepository $repository)
|
|
|
{
|
|
{
|
|
|
$data = $this->oil_checkParams($validate);
|
|
$data = $this->oil_checkParams($validate);
|
|
|
-// $grade = $repository->where('grade', $data['grade'])->find();
|
|
|
|
|
$grade = app()->make(OilLevelRepository::class)->getSearch([])->where('grade', $data['grade'])->find();
|
|
$grade = app()->make(OilLevelRepository::class)->getSearch([])->where('grade', $data['grade'])->find();
|
|
|
if ($grade){
|
|
if ($grade){
|
|
|
return app('json')->fail('等级已存在');
|
|
return app('json')->fail('等级已存在');
|
|
|
}
|
|
}
|
|
|
|
|
+ $data['update_time'] = time();
|
|
|
$repository->create($data);
|
|
$repository->create($data);
|
|
|
return app('json')->success('添加成功');
|
|
return app('json')->success('添加成功');
|
|
|
|
|
|
|
@@ -125,7 +125,7 @@ class Award extends BaseController
|
|
|
$data = $this->oil_checkParams($validate);
|
|
$data = $this->oil_checkParams($validate);
|
|
|
// if (!$this->repository->merExists($this->request->merId(), $id))
|
|
// if (!$this->repository->merExists($this->request->merId(), $id))
|
|
|
// return app('json')->fail('数据不存在');
|
|
// return app('json')->fail('数据不存在');
|
|
|
- $grade = $repository->where('grade', $data['grade'])->find();
|
|
|
|
|
|
|
+ $grade = app()->make(OilLevelRepository::class)->getSearch([])->where('grade', $data['grade'])->find();
|
|
|
if ($grade){
|
|
if ($grade){
|
|
|
return app('json')->fail('等级已存在');
|
|
return app('json')->fail('等级已存在');
|
|
|
}
|
|
}
|