| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 | <?phpnamespace App\Http\Requests\Site;use App\Http\Requests\Request;use Illuminate\Validation\Rule;use Illuminate\Database\Query\Builder;class SiteOverviewRequest extends Request{    /**     * Determine if the user is authorized to make this request.     *     * @return bool     */    public function authorize()    {        return true;    }    /**     * Get the validation rules that apply to the request.     *     * @return array     */    public function rules()    {        if (!$this->ajax()) {            return [];        }        //基础信息认证        if ($this->input('type') == 1) {            return [                'site.cn_title' => 'required',                'site.en_title' => 'required',                'site.site_logo' => 'nullable',                'site.business_license_business_scope' => 'nullable',                'site.domain' => 'required',                'site.site_type' => 'required',                'site.nature_type' => 'required',                'site.business_id' => 'required',                'site.area_text' => 'required|array',                'site.remark' => 'nullable',                'site.contacts' => 'required|array',                'site.contract_ids' => 'required|array',                'site.customer_demand_type' => 'required',                'site.sign_amount' => 'required|numeric',                'site.pay_way' => 'required',                'site.data_prepare_level' => 'nullable',                'site.keyword_know_level' => 'nullable',                'site.is_rebuild' => 'nullable',                'site.is_design_all' => 'nullable',                'site.keyword_goal' => 'required|numeric',                'site.link_goal' => 'required|numeric',                'site.article_goal' => 'required|numeric',                'site.other_demand' => 'nullable',                'site.package_type' => 'nullable',                'site.enterprise_nature' => 'nullable',                'site.case_ids' => 'nullable',                'site.brand' => 'nullable',                'site.core_product' => 'nullable',                'site.example_url' => 'nullable',                'site.article_difference' => 'nullable',            ];        } elseif ($this->input('type') == 2) {         //详细认证            return [                'payment.refund' => 'nullable',//退款金额                'payment.refund_reason' => 'nullable',//退款原因                'payment.refund_reason_analyze' => 'nullable',//退款原因分析                'payment.not_renewed_reason' => 'nullable',//未续费原因                'payment.not_renewed_reason_analyze' => 'nullable',//未续费原因分析                'payment.remarks' => 'nullable',                'payment.head' => 'required',                'payment.head_pic' => 'nullable',                'payment.head_type' => 'nullable',                'payment.head_invoicing_type' => 'nullable',                'payment.done' => 'required',                'payment.done_pic' => 'nullable',                'payment.done_type' => 'nullable',                'payment.done_invoicing_type' => 'nullable',                'payment.reach' => 'required',                'payment.reach_pic' => 'nullable',                'payment.reach_type' => 'nullable',                'payment.reach_invoicing_type' => 'nullable',                'payment.service_final_payment' => 'nullable',                'payment.service_final_payment_pic' => 'nullable',                'payment.service_final_payment_type' => 'nullable',                'payment.service_final_payment_invoicing_type' => 'nullable',                'payment.renewal' => 'required',                'payment.renewal_pic' => 'nullable',                'payment.renewal_type' => 'nullable',                'payment.renewal_invoicing_type' => 'nullable',                'payment.contract_total_fee' => 'nullable',                'payment.google_optimize_fee' => 'nullable',                'payment.bid_give_fee' => 'nullable',                'payment.google_bid' => 'nullable',                'payment.bid_score' => 'nullable',                'payment.bid_score_time' => 'nullable',                'payment.bid_login_account' => 'nullable',                'payment.bid_account_online_time' => 'nullable',                'payment.bid_account_pause_time' => 'nullable',                'payment.wiki_fee' => 'nullable',                'payment.other_fee' => 'nullable',            ];        } elseif ($this->input('type') == 3) {            return [                'allot.editor_ids' => 'nullable|array',                'allot.article_ids' => 'nullable|array',                'allot.server_ids' => 'nullable|array',                'allot.manager_ids' => 'nullable|array',                'allot.manage_helper_ids' => 'nullable|array',                //'allot.planner_ids' => 'nullable|array',                'allot.optimizer_ids' => 'nullable|array',                'allot.bid_user_ids' => 'nullable|array',                'allot.seller_ids' => 'nullable|array',                'allot.web_ids' => 'nullable|array',                'allot.designer_ids' => 'nullable|array',                'allot.article_edit_ids' => 'nullable|array',                'allot.external_link_ids' => 'nullable|array',                'allot.chongqing_link_ids' => 'nullable|array',                'allot.optimization_editing_ids' => 'nullable|array',            ];        } elseif ($this->input('type') == 4) {         //时间节点与评分            return [                'site.sign_at' => 'nullable',//合同签订时间                'site.order_at' => 'nullable',//下单时间                //'site.assign_at' => 'nullable',//分配时间                'site.online_at' => 'nullable',//上线时间                'site.reach_at' => 'nullable',//达标时间                'site.expired_at' => 'nullable',//到期时间                'site.renewal_times' => 'nullable',//续费次数                'site.renewal_at' => 'nullable',//续费时间                'site.renew_years' => 'nullable',//续费年限                'site.status' => 'required|numeric',//项目状态                'site.domain_expired_date' => 'nullable',//域名到期时间                'site.cdn_expired_date' => 'nullable',//cdn到期时间                'site.cert_expired_date' => 'nullable',//证书到期时间                'site.design_score' => 'nullable',//设计评分                'site.online_score' => 'nullable',//上线评分                'site.reach_score' => 'nullable',//达标评分                'site.renewal_amount' => 'nullable',//续费金额                'site.renewal_end_at' => 'nullable',//续费结束时间                'site.bq_at' => 'nullable',//百千约访时间                'site.bq_score' => 'nullable',//百千客户评分                'site.task_at' => 'nullable',//任务起始时间                'site.refund_date' => 'nullable',//退款时间                'site.reach_mail_at' => 'nullable',//达标邮件确认时间                'site.reach_pay_at' => 'nullable',//达标款支付时间            ];        } elseif ($this->input('type') == 5) {         //服务器及配置            return [                'site.server_id' => 'nullable',//服务器所在地                'site.self_support' => 'nullable',//是否是引擎力服务器                'site.is_stencil' => 'nullable',//是否是模版站                'site.api_url' => 'nullable',//api地址                'site.webmaster_domain' => 'nullable', // 注意数字字符串验证方式是字符数                'site.database' => 'nullable', // 注意数字字符串验证方式是字符数                'site.code_dir' => 'nullable',//项目代码目录                'site.cname_host_record_value' => 'nullable',//CNAME主机记录                'site.cname_record_value' => 'nullable',//CNAME记录值            ];        }    }    public function attributes()    {        return [            'site.cn_title' => '中文项目名称',            'site.en_title' => '英文项目名称',            'site.domain' => '域名',            'site.site_type' => '项目类型',            'site.nature_type' => '公司性质',            'site.order_at' => '下单时间',            'site.online_at' => '上线时间',            'site.reach_at' => '达标时间',            'site.expired_at' => '到期时间',            'site.business_id' => '所属行业',            'site.area_text' => '地区',            'site.remark' => '其他备注',            'site.contacts' => '客户联系人',            'site.contract_ids' => '服务项目',            'site.customer_demand_type' => '客户需求',            'site.sign_amount' => '签单价格',            'site.pay_way' => ' 付款方式',            'site.data_prepare_level' => '客户资料准备程度',            'site.keyword_know_level' => '对关键词了解程度',            'site.domain_expired_date' => '域名到期时间',            'site.cert_expired_date' => '证书到期时间',            'site.keyword_goal' => '关键词达标数',            'site.link_goal' => '外链平台数',            'site.article_goal' => '软文达标数',            'site.other_demand' => '其他需求',            'site.status' => '项目状态',            'site.server_id' => '服务器ip所在地',            'site.api_url' => 'api地址',            'site.report_day' => '月报日',            'site.webmaster_domain' => 'webmaster验证域名',            'site.database' => '项目数据库名',            'site.code_dir' => '项目代码目录',            'site.facebook_page' => 'facebook公司主页',            'payment.head' => '首付',            'payment.head_pic' => '首付快照',            'payment.done' => '建站收款',            'payment.done_pic' => '建站收款快照',            'payment.reach' => '达标尾款',            'payment.reach_pic' => '达标尾款快照',            'payment.service_final_payment' => '服务期尾款',            'payment.renewal' => '续费',            'payment.renewal_pic' => '续费快照',            'payment.contract_total_fee' => '合同总金额',            'payment.google_optimize_fee' => '谷歌优化费用',            'payment.google_bid_fee' => '谷歌竞价费用',            'payment.wiki_fee' => '维基百科费用',            'payment.other_fee' => '其他费用',            'allot.editor_ids' => '采编人员',            'allot.server_ids' => '客服人员',            'allot.manager_ids' => '项目经理',            'allot.manage_helper_ids' => '项目助理',            'allot.optimizer_ids' => '优化师',            'allot.bid_user_ids' => '竞价人员',            'allot.seller_ids' => '销售人员',        ];    }}
 |