|
@@ -26,9 +26,9 @@ use App\Model\Sector;
|
|
|
use App\Model\Component;
|
|
|
use App\Model\Link;
|
|
|
use App\Model\FooterCategory;
|
|
|
+use App\Model\Size;
|
|
|
|
|
|
use function Hyperf\Support\retry;
|
|
|
-use App\Model\Company;
|
|
|
use Hyperf\Paginator\Paginator;
|
|
|
use App\Model\User;
|
|
|
#[RpcService(name: "PublicRpcService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
@@ -772,21 +772,31 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
if($template->type == 1){
|
|
|
return Result::error("默认风格不能删除", 0);
|
|
|
}
|
|
|
- $result = TemplateClass::where($where)->delete();
|
|
|
- if (empty($result)) {
|
|
|
- return Result::error("删除失败", 0);
|
|
|
- } else {
|
|
|
- return Result::success($result);
|
|
|
+
|
|
|
+ try{
|
|
|
+ // 默认风格 1
|
|
|
+ $template = Template::where('template_class_id',$data['id'])->update(['template_class_id'=>1]);
|
|
|
+ if(empty($template)){
|
|
|
+ Db::rollBack();
|
|
|
+ return Result::error("删除失败", 0);
|
|
|
+ }
|
|
|
+ $result = TemplateClass::where($where)->delete();
|
|
|
+ }catch (\Exception $e){
|
|
|
+ return Result::error("删除失败".$e->getMessage(), 0);
|
|
|
}
|
|
|
+ return Result::success($result);
|
|
|
}
|
|
|
/**
|
|
|
- * 获取getTemplateClass
|
|
|
+ * 根据风格名称-获取获取所有风格
|
|
|
* @param array $data
|
|
|
* @return array
|
|
|
*/
|
|
|
public function getTemplateClass(array $data): array
|
|
|
{
|
|
|
- $result = TemplateClass::get();
|
|
|
+ $result = TemplateClass::where('name','like','%'.$data['template_name'].'%')->get();
|
|
|
+ if(empty($result)){
|
|
|
+ return Result::error("暂无风格", 0);
|
|
|
+ }
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
/**
|
|
@@ -807,7 +817,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
array_push($where, ['template_keyword', 'like', '%'. $data['template_keyword']. '%']);
|
|
|
}
|
|
|
$result = Template::where($where)
|
|
|
- ->leftJoin('template_class', 'template.template_class_id', 'template_class.id')
|
|
|
+ ->leftJoin('template_class', 'template.template_class_id', 'template_class.class_id')
|
|
|
->select('template.*', 'template_class.name as template_class_name')
|
|
|
->orderBy('template.id', 'desc')
|
|
|
->paginate($data['page_size'], ['*'], 'mypage_name', $data['page']);
|
|
@@ -819,7 +829,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
public function getTemplateInfo(array $data): array
|
|
|
{
|
|
|
$result = Template::where('template.id', $data['id'])
|
|
|
- ->leftJoin('template_class', 'template.template_class_id', 'template_class.id')
|
|
|
+ ->leftJoin('template_class', 'template.template_class_id', 'template_class.class_id')
|
|
|
->select('template.*', 'template_class.name as template_class_name')
|
|
|
->first();
|
|
|
if(empty($result)){
|
|
@@ -857,8 +867,12 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
* @param array $data
|
|
|
* @return array
|
|
|
*/
|
|
|
- public function delTemplate(array $data): array
|
|
|
+ public function delTemplate(array $data): array
|
|
|
{
|
|
|
+ $rector = Sector::where('template_id', $data['id'])->first();
|
|
|
+ if (!empty($rector)) {
|
|
|
+ return Result::error("此皮肤已被绑定,不可删除", 0);
|
|
|
+ }
|
|
|
$result = Template::where('id', $data['id'])->delete();
|
|
|
var_dump($result, '-------------------delete');
|
|
|
if ($result) {
|
|
@@ -900,42 +914,74 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
return Result::success('更新成功');
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 根据皮肤名称-获取所有皮肤
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function getAllTemplate(array $data): array
|
|
|
+ {
|
|
|
+ $result = Template::where('template_name','like','%'.$data['template_name'].'%')->get();
|
|
|
+ if(empty($result)){
|
|
|
+ return Result::error("暂无皮肤", 0);
|
|
|
+ }
|
|
|
+ return Result::success($result);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 获取通栏列表
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
public function getSectorList(array $data): array
|
|
|
{
|
|
|
$where = [];
|
|
|
- if (!empty($data['template_class_id'])) {
|
|
|
- $where['template_class.id'] = $data['template_class_id'];
|
|
|
+ if (isset($data['template_class_id']) && !empty($data['template_class_id'])) {
|
|
|
+ $where['template_class_id'] = $data['template_class_id'];
|
|
|
}
|
|
|
- if (!empty($data['template_class_name'])) {
|
|
|
- $where[] = ['template_class.name', 'like', '%' . $data['template_class_name'] . '%'];
|
|
|
+ if (isset($data['template_id']) && !empty($data['template_id'])) {
|
|
|
+ array_push($where, ['template_id', $data['template_id']]);
|
|
|
}
|
|
|
-
|
|
|
- if (!empty($data['sector_name'])) {
|
|
|
- if (!empty($data['sector_name'])) {
|
|
|
- // $where['sector_name'] = $data['sector_name'];
|
|
|
- $where[] = ['sector.sector_name', 'like', '%' . $data['sector_name'] . '%'];
|
|
|
- }
|
|
|
+ if (isset($data['sector_name']) && !empty($data['sector_name'])) {
|
|
|
+ array_push($where, ['sector.sector_name', 'like', '%' . $data['sector_name'] . '%']);
|
|
|
}
|
|
|
-
|
|
|
+ if (isset($data['width']) && !empty($data['width']) && isset($data['height']) && !empty($data['height'])){
|
|
|
+ $size_id = Size::where('width','like','%' .$data['width'].'%')->where('height','like','%' .$data['height'].'%')->pluck('id');
|
|
|
+ } else if( isset($data['width']) && !empty($data['width'])){
|
|
|
+ $size_id = Size::where('width','like','%' .$data['width'].'%')->pluck('id');
|
|
|
+ }else if( isset($data['height']) && !empty($data['height'])){
|
|
|
+ $size_id = Size::where('height','like','%' .$data['height'].'%')->pluck('id');
|
|
|
+ }else{
|
|
|
+ $size_id = [];
|
|
|
+ }
|
|
|
+ // $size_id = $size_id->toArray();
|
|
|
$result = Sector::where($where)
|
|
|
- ->leftJoin('template', 'template.id', '=', 'sector.template_id')
|
|
|
- ->leftJoin('template_class', 'template_class.id', '=', 'sector.template_id') // 添加这一行
|
|
|
- ->select('sector.*', 'sector.sector_name', 'template.template_name', 'template_class.name as template_class_name', 'template_class.id as template_class_id') // 修改这一行
|
|
|
+ ->when(!empty($size_id), function ($query) use ($size_id) {
|
|
|
+ $query->whereIn('size_id', $size_id);
|
|
|
+ })
|
|
|
+ ->leftJoin('size', 'size.id', '=', 'sector.size_id')
|
|
|
+ ->select('sector.*', 'size.width','size.height')
|
|
|
->orderBy('sector.id', 'desc')
|
|
|
- ->paginate($data['page_size'], ['*'], 'mypage_name', $data['page']);
|
|
|
-
|
|
|
+ ->paginate($data['page_size'], ['*'], 'page', $data['page']);
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 获取通栏详情
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+
|
|
|
public function getSectorInfo(array $data): array
|
|
|
{
|
|
|
$where = [];
|
|
|
$where[] = ['sector.id', '=', $data['id']];
|
|
|
$result = Sector::where($where)
|
|
|
- ->leftJoin('template', 'template.id', '=', 'sector.template_id')
|
|
|
- ->leftJoin('template_class', 'template_class.id', '=', 'template.template_class_id') // 添加这一行
|
|
|
- ->select('sector.*', 'template.template_name', 'template_class.name as template_class_name', 'template_class.id as template_class_id') // 修改这一行
|
|
|
+ ->leftJoin('size', 'size.id', '=', 'sector.size_id')
|
|
|
+ ->select('sector.*', 'size.width','size.height')
|
|
|
->orderBy('sector.id', 'desc')
|
|
|
- ->get();
|
|
|
+ ->first();
|
|
|
+ if(empty($result)){
|
|
|
+ return Result::error('此通栏不存在!');
|
|
|
+ }
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
|
|
@@ -1014,16 +1060,52 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
$result = $calendar->solar($data['year'], $data['month'], $data['day'], $data['hour']); // 阳历
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 添加通栏
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
public function addSector(array $data): array
|
|
|
{
|
|
|
unset($data['user_id']);
|
|
|
- // $data['page_type'] = json_encode($data['page_type']);
|
|
|
+ // 对传入的 page_type 数组进行去重、转换为整数并重新索引
|
|
|
+ $data['page_type'] = array_values(array_unique(array_map('intval', $data['page_type'])));
|
|
|
+ $data['page_type'] = json_encode($data['page_type']);
|
|
|
+ $template = Template::where('template_id', $data['template_id'])
|
|
|
+ ->whereRaw("JSON_CONTAINS(template.page_type, ?)", [$data['page_type']])
|
|
|
+ ->first();
|
|
|
+ if(empty($template)){
|
|
|
+ return Result::error('皮肤不存在!');
|
|
|
+ }
|
|
|
+ // 皮肤相关信息
|
|
|
+ $data['template_name'] = $template['template_name'];
|
|
|
+ $data['template_id'] = $template['template_id'];
|
|
|
+ // 风格相关信息
|
|
|
+ $template_class = TemplateClass::where('class_id',$template['template_class_id'])->first();
|
|
|
+ if(empty($template_class)){
|
|
|
+ return Result::error('所属风格不存在!');
|
|
|
+ }
|
|
|
+ // $data['sector_keyword'] = json_encode($data['sector_keyword']);
|
|
|
+ $data['template_class_id'] = $template_class['class_id'];
|
|
|
+ $data['template_class_name'] = $template_class['name'];
|
|
|
+
|
|
|
$result = Sector::insertGetId($data);
|
|
|
- return Result::success();
|
|
|
+ if(empty($result)){
|
|
|
+ return Result::error('添加失败');
|
|
|
+ }
|
|
|
+ return Result::success($result);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 删除通栏
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
public function delSector(array $data): array
|
|
|
{
|
|
|
+ $component_id = Component::where('sector_id', $data['id'])->pluck('id')->toArray();
|
|
|
+ if(!empty($component_id)){
|
|
|
+ return Result::error('请先删除相关组件!');
|
|
|
+ }
|
|
|
$result = Sector::where('id', $data['id'])->delete();
|
|
|
if ($result == 1) {
|
|
|
return Result::success('删除成功');
|
|
@@ -1031,9 +1113,38 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
return Result::error('删除失败');
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 修改通栏
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
public function updateSector(array $data): array
|
|
|
{
|
|
|
unset($data['user_id']);
|
|
|
+ $sector = Sector::where('id', $data['id'])->first();
|
|
|
+ if(empty($sector)){
|
|
|
+ return Result::error('通栏不存在!');
|
|
|
+ }
|
|
|
+ // 对传入的 page_type 数组进行去重、转换为整数并重新索引
|
|
|
+ $data['page_type'] = array_values(array_unique(array_map('intval', $data['page_type'])));
|
|
|
+ $data['page_type'] = json_encode($data['page_type']);
|
|
|
+ $template = Template::where('template_id', $data['template_id'])
|
|
|
+ ->whereRaw("JSON_CONTAINS(template.page_type, ?)", [$data['page_type']])
|
|
|
+ ->first();
|
|
|
+ if(empty($template)){
|
|
|
+ return Result::error('皮肤不存在!');
|
|
|
+ }
|
|
|
+ // 皮肤相关信息
|
|
|
+ $data['template_name'] = $template['template_name'];
|
|
|
+ $data['template_id'] = $template['template_id'];
|
|
|
+ // 风格相关信息
|
|
|
+ $template_class = TemplateClass::where('class_id',$template['template_class_id'])->first();
|
|
|
+ if(empty($template_class)){
|
|
|
+ return Result::error('所属风格不存在!');
|
|
|
+ }
|
|
|
+ // $data['sector_keyword'] = json_encode($data['sector_keyword']);
|
|
|
+ $data['template_class_id'] = $template_class['class_id'];
|
|
|
+ $data['template_class_name'] = $template_class['name'];
|
|
|
$result = Sector::where('id', $data['id'])->update($data);
|
|
|
if ($result == 1) {
|
|
|
return Result::success('修改成功');
|
|
@@ -1131,9 +1242,18 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
if(empty($footer_category->toArray())){
|
|
|
return Result::error('暂无底部导航数据!');
|
|
|
}
|
|
|
+ $page_type = WebsiteTemplateInfo::where('website_id', $data['website_id'])->value('page_type');
|
|
|
+ $page_type = json_decode($page_type,true);
|
|
|
+ // '网站页面类型(存数组)1:首页 2:分类页 3:列表页 4:详情页 5:搜索页 6:特殊列表 7:特殊详情页
|
|
|
+ if(isset($page_type) && in_array(5,$page_type)){
|
|
|
+ $page_type = 1;
|
|
|
+ }else{
|
|
|
+ $page_type = 0;
|
|
|
+ }
|
|
|
$result = [
|
|
|
'friend_link' => $friend_link,
|
|
|
'footer_category' => $footer_category,
|
|
|
+ 'page_type' => $page_type,
|
|
|
];
|
|
|
return Result::success($result);
|
|
|
}
|
|
@@ -1144,6 +1264,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
*/
|
|
|
public function addWebPageType(array $data): array
|
|
|
{
|
|
|
+ // return Result::success($data);
|
|
|
// 1:首页 2:频道页 3:列表页 4:详情页 5:搜索页 6:特殊列表 7:特殊详情页'
|
|
|
if($data['is_search'] == 1){
|
|
|
$page_type = json_encode([1,2,3,4,5,6,7]);
|
|
@@ -1151,7 +1272,19 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
$page_type = json_encode([1,2,3,4,6,7]);
|
|
|
}
|
|
|
// 0:未构建;1:已填写基础信息;2:已选择模板; action_id
|
|
|
- $result = WebsiteTemplateInfo::where('website_id', $data['website_id'])->update(['page_type' => $page_type],['action_id' => 1]);
|
|
|
+ $website_template_info = WebsiteTemplateInfo::where('website_id', $data['website_id'])->first();
|
|
|
+ // return Result::success($website_template_info);
|
|
|
+
|
|
|
+ // return Result::success(empty($website_template_info));
|
|
|
+ if(empty($website_template_info)){
|
|
|
+ $result = WebsiteTemplateInfo::insertGetId(['website_id' => $data['website_id'], 'page_type' => $page_type, 'user_id' => $data['user_id']]);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ if($website_template_info['action_id'] == 2){
|
|
|
+ return Result::error('网站已应用,不可再次修改!');
|
|
|
+ }
|
|
|
+ $result = WebsiteTemplateInfo::where('website_id', $data['website_id'])->update(['page_type' => $page_type],['action_id' => 1,'user_id' => $data['user_id']]);
|
|
|
+ }
|
|
|
if ($result) {
|
|
|
return Result::success($result);
|
|
|
} else {
|
|
@@ -1216,6 +1349,12 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
$result['template'] = Template::orderBy('updated_at','desc')
|
|
|
->paginate($data['page_size'], ['*'], 'page', $data['page']);
|
|
|
}
|
|
|
+ $template = WebsiteTemplateInfo::where('website_id', $data['website_id'])->value('template_id');
|
|
|
+ if($template){
|
|
|
+ $result['template_id'] = $template;
|
|
|
+ }else{
|
|
|
+ $result['template_id'] = 0;
|
|
|
+ }
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
/**
|
|
@@ -1246,7 +1385,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
- * 自助建站---流程---5.选择组件
|
|
|
+ * 自助建站---流程---5.保存模版
|
|
|
* @param array $data
|
|
|
* @return array
|
|
|
*/
|
|
@@ -1263,9 +1402,13 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
if($website_template_info['action_id'] != 2){
|
|
|
return Result::error('请完成之前的步骤!');
|
|
|
}
|
|
|
- $template_info = WebsiteTemplateInfo::where('website_id', $data['website_id'])->first();
|
|
|
+ $template_info = WebsiteTemplate::where('website_id', $data['website_id'])->first();
|
|
|
+ var_dump($data['template_data']);
|
|
|
if(empty($template_info)){
|
|
|
- $template = WebsiteTemplate::insertGetId(['website_id' => $data['website_id'],'template_data' => $data['template_data']]);
|
|
|
+ $template = WebsiteTemplate::insertGetId([
|
|
|
+ 'website_id' => $data['website_id'],
|
|
|
+ 'template_data' => $data['template_data']
|
|
|
+ ]);
|
|
|
}else{
|
|
|
$template = WebsiteTemplate::where('website_id', $data['website_id'])->update(['template_data' => $data['template_data']]);
|
|
|
}
|
|
@@ -1275,146 +1418,5 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
return Result::success($template);
|
|
|
}
|
|
|
}
|
|
|
- /**
|
|
|
- * 企业管理
|
|
|
- * @param array $data
|
|
|
- * @return array
|
|
|
- */
|
|
|
- public function getCompanyList(array $data): array
|
|
|
- {
|
|
|
- $where = [];
|
|
|
- $user = User::where('id', $data['user_id'])->first();
|
|
|
- if(empty($user)){
|
|
|
- return Result::error('用户不存在!');
|
|
|
- }
|
|
|
- if($user['type_id']!= 10000){
|
|
|
- $where['user_id'] = $data['user_id'];
|
|
|
- }
|
|
|
- if(isset($data['title']) && $data['title']){
|
|
|
- array_push($where, ['title', 'like', '%'. $data['title']. '%']);
|
|
|
- }
|
|
|
- if(isset($data['website_id']) && $data['website_id']){
|
|
|
- $where['website_id'] = $data['website_id'];
|
|
|
- }
|
|
|
- // 状态:0:未审核 1:已审核 2:已拒绝
|
|
|
- $pageSize = isset($data['pageSize']) ? (int)$data['pageSize'] : 10; // 默认每页 10 条记录
|
|
|
- $page = isset($data['page']) ? (int)$data['page'] : 1; // 默认第 1 页
|
|
|
- if(isset($data['ischeck']) && !empty($data['ischeck'])){
|
|
|
- if($data['ischeck'] == 1){
|
|
|
- $query = Company::whereIn('status', [0,2]);
|
|
|
- }else{
|
|
|
- $query = Company::where('status', 1);
|
|
|
- }
|
|
|
- }
|
|
|
- $result = $query->where($where)->paginate($pageSize, ['*'], 'page', $page);
|
|
|
- if(empty($result)){
|
|
|
- return Result::error("暂无企业", 0);
|
|
|
- }
|
|
|
- return Result::success($result);
|
|
|
- }
|
|
|
- /**
|
|
|
- * 添加企业
|
|
|
- * @param array $data
|
|
|
- * @return array
|
|
|
- */
|
|
|
- public function addCompany(array $data): array
|
|
|
- {
|
|
|
- $data['category_id'] = isset($data['cat_arr_id']) ? end($data['cat_arr_id']) : '';
|
|
|
- $data['cat_arr_id'] = isset($data['cat_arr_id']) ? json_encode($data['cat_arr_id']) : '';
|
|
|
- $user = User::where('id', $data['user_id'])->first();
|
|
|
- if(empty($user)){
|
|
|
- return Result::error('用户不存在!');
|
|
|
- }
|
|
|
- if($user['type_id']== 10000){
|
|
|
- $data['status'] = 1;
|
|
|
- }
|
|
|
- $result = Company::insertGetId($data);
|
|
|
- if ($result) {
|
|
|
- return Result::success($result);
|
|
|
- } else {
|
|
|
- return Result::error('添加失败');
|
|
|
- }
|
|
|
- }
|
|
|
- /**
|
|
|
- * 更新企业
|
|
|
- * @param array $data
|
|
|
- * @return array
|
|
|
- */
|
|
|
- public function upCompany(array $data): array
|
|
|
- {
|
|
|
- $data['category_id'] = isset($data['cat_arr_id']) ? end($data['cat_arr_id']) : '';
|
|
|
- $data['cat_arr_id'] = isset($data['cat_arr_id']) ? json_encode($data['cat_arr_id']) : '';
|
|
|
- $user = User::where('id', $data['user_id'])->first();
|
|
|
- if(empty($user)){
|
|
|
- return Result::error('用户不存在!');
|
|
|
- }
|
|
|
- if($user['type_id']== 10000){
|
|
|
- $data['status'] = 1;
|
|
|
- }else{
|
|
|
- $data['status'] = 0;
|
|
|
- }
|
|
|
- $result = Company::where('id', $data['id'])->update($data);
|
|
|
- if ($result) {
|
|
|
- return Result::success($result);
|
|
|
- } else {
|
|
|
- return Result::error('修改失败');
|
|
|
- }
|
|
|
- }
|
|
|
- /**
|
|
|
- * 删除企业
|
|
|
- * @param array $data
|
|
|
- * @return array
|
|
|
- */
|
|
|
- public function delCompany(array $data): array
|
|
|
- {
|
|
|
- $result = Company::where('id', $data['id'])->delete();
|
|
|
- if ($result) {
|
|
|
- return Result::success($result);
|
|
|
- } else {
|
|
|
- return Result::error('删除失败');
|
|
|
- }
|
|
|
- }
|
|
|
- /**
|
|
|
- * 审核企业
|
|
|
- * @param array $data
|
|
|
- * @return array
|
|
|
- */
|
|
|
- public function checkCompany(array $data): array
|
|
|
- {
|
|
|
- $user = User::where('id', $data['user_id'])->first();
|
|
|
- if(empty($user)){
|
|
|
- return Result::error('用户不存在!');
|
|
|
- }
|
|
|
- if($user['type_id'] != 10000){
|
|
|
- return Result::error('用户权限不足!');
|
|
|
- }
|
|
|
- $company = Company::where('id', $data['id'])->first();
|
|
|
- if(empty($company)){
|
|
|
- return Result::error('企业不存在!');
|
|
|
- }
|
|
|
- // 状态:0:未审核 1:已审核 2:已拒绝
|
|
|
- if($company['status'] == 0){
|
|
|
- switch ($data['status']) {
|
|
|
- case 0:
|
|
|
- return Result::error('请选择审核状态!');
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- $result = Company::where('id', $data['id'])->update(['status' => $data['status']]);
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- $result = Company::where('id', $data['id'])->update(['status' => $data['status'],'reject_reason'=> $data['reject_reason']]);
|
|
|
- break;
|
|
|
- default:
|
|
|
- return Result::error('请选择审核状态!');
|
|
|
- break;
|
|
|
- }
|
|
|
- }else{
|
|
|
- return Result::error('企业已审核!');
|
|
|
- }
|
|
|
- if(empty($result)){
|
|
|
- return Result::error('审核失败!');
|
|
|
- }else{
|
|
|
- return Result::success($result);
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
}
|