|
@@ -21,6 +21,8 @@ class YinliuManageController extends CatchController
|
|
public function list(Request $request) {
|
|
public function list(Request $request) {
|
|
$gzhId = $request->input('gzh_id');
|
|
$gzhId = $request->input('gzh_id');
|
|
$gzhIsEnabled = $request->input('gzh_is_enabled');
|
|
$gzhIsEnabled = $request->input('gzh_is_enabled');
|
|
|
|
+ $name = $request->input('name');
|
|
|
|
+ $focusType = $request->input('focus_type');
|
|
|
|
|
|
$result = DB::table('yinliu_gzh_config as a')
|
|
$result = DB::table('yinliu_gzh_config as a')
|
|
->leftJoin('wechat_authorization_infos as b', 'a.gzh_id','=', 'b.id')
|
|
->leftJoin('wechat_authorization_infos as b', 'a.gzh_id','=', 'b.id')
|
|
@@ -28,6 +30,10 @@ class YinliuManageController extends CatchController
|
|
return $query->where('a.gzh_id', $gzhId);
|
|
return $query->where('a.gzh_id', $gzhId);
|
|
})->when($gzhIsEnabled, function ($query, $gzhIsEnabled) {
|
|
})->when($gzhIsEnabled, function ($query, $gzhIsEnabled) {
|
|
return $query->where('b.is_enabled', $gzhIsEnabled);
|
|
return $query->where('b.is_enabled', $gzhIsEnabled);
|
|
|
|
+ })->when($name, function ($query, $name) {
|
|
|
|
+ return $query->where('name', 'like', '%'. $name . '%');
|
|
|
|
+ })->when($focusType, function ($query, $focusType) {
|
|
|
|
+ return $query->where('focus_type', $focusType);
|
|
})
|
|
})
|
|
->where([
|
|
->where([
|
|
'a.uid' => $this->getLoginUserId(),
|
|
'a.uid' => $this->getLoginUserId(),
|
|
@@ -49,6 +55,7 @@ class YinliuManageController extends CatchController
|
|
*/
|
|
*/
|
|
public function save(Request $request) {
|
|
public function save(Request $request) {
|
|
$this->validate($request, [
|
|
$this->validate($request, [
|
|
|
|
+ 'name' => 'required|string|max:64',
|
|
'focus_type' => 'required|in:1',
|
|
'focus_type' => 'required|in:1',
|
|
'gzh_id' => 'required',
|
|
'gzh_id' => 'required',
|
|
// 播放页弹窗设置:1-强制关注,2-引导关注,3-不关注
|
|
// 播放页弹窗设置:1-强制关注,2-引导关注,3-不关注
|
|
@@ -59,7 +66,8 @@ class YinliuManageController extends CatchController
|
|
'link_url' => 'required',
|
|
'link_url' => 'required',
|
|
]);
|
|
]);
|
|
|
|
|
|
- $data = $request->only('focus_type', 'gzh_id', 'pop_type', 'link_type', 'link_url', 'pop_type_sub');
|
|
|
|
|
|
+ $data = $request->only('name' ,'focus_type', 'gzh_id', 'pop_type',
|
|
|
|
+ 'link_type', 'link_url', 'pop_type_sub');
|
|
if(2 != $data['pop_type']) {
|
|
if(2 != $data['pop_type']) {
|
|
$data['pop_type_sub'] = 0;
|
|
$data['pop_type_sub'] = 0;
|
|
}
|
|
}
|