1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace App\Http\Requests\Sell;
- use App\Http\Requests\Request;
- use Illuminate\Database\Query\Builder;
- use Illuminate\Validation\Rule;
- class AgentSaveRequest 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 [];
- }
- return [
- 'agent_type' => 'required',
- // 'user_id' => [
- // 'required',
- // Rule::unique('agent_sellers')->where(function (Builder $query) {
- // return $query->where('deleted_at', null);
- // })->ignore($this->route('id'))
- // ],
- 'user_id' => 'nullable',
- 'company_name' => 'required',
- 'area' => 'required',
- 'channel_ids' => 'required|array',
- 'sign_at' => 'required',
- 'contact_name' => 'required',
- 'mobile' => 'required',
- 'tencent' => 'nullable',
- 'discount' => 'required|integer|min:1',
- 'cash_deposit' => 'required',
- ];
- }
- public function attributes()
- {
- return [
- 'agent_type' => '代理商类型',
- 'user_id' => '人员',
- 'company_name' => '公司名称',
- 'area' => '所在区域',
- 'channel_ids' => '渠道人员',
- 'sign_at' => '签约时间',
- 'contact_name' => '联系人',
- 'mobile' => '手机号',
- 'tencent' => '微信号/QQ号',
- 'discount' => '折扣',
- 'cash_deposit' => '保证金/预充值'
- ];
- }
- }
|