| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -116,10 +116,20 @@ class ProductController extends AdminController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								$options = Category::selectOptions(fn($query) => $query->where('agent_id', 0)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $form->select('category_id')->options(array_slice($options, 1, null, true))->required(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								//信息收集表单
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								$options = DiyForm::where('supplier_id', Admin::user()->id)->pluck('name', 'id'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if ($options->isEmpty()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$form->select('diy_form_id', '信息收集表单') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										->help('提示:信息收集表单为空,请前往“<a href="' . admin_url('diy_form') . '">信息收集表单</a>”处新增') | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										->options($options)->required(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$form->select('diy_form_id', '信息收集表单')->options($options)->required(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $form->text('title')->required(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//            $form->currency('price')->symbol('¥')->required();
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//            $form->currency('original_price')->symbol('¥')->required();
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $form->number('service_persons')->min(1)->required(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//			$form->number('stock')->required();
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								$form->hasMany('spec', function (NestedForm $form) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$form->hidden('id'); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -136,6 +146,7 @@ class ProductController extends AdminController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									.has-many-spec .input-group>.form-control:not(:first-child){border-radius:.25rem;}'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									Admin::script(file_get_contents(resource_path('js/supplier-batch-add-spec.js'))); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								})->useTable()->required(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								$form->number('service_persons')->min(1)->required(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if ($form->isEditing() && in_array($form->model()->status, [ProductStatus::SOLD_OUT, ProductStatus::ON_SALE])) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$form->radio('status')->options([1 => '上架', -2 => '下架'])->default(1); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -144,10 +155,6 @@ class ProductController extends AdminController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								$form->editor('content')->required(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								$form->mobile('verify_mobile')->required(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								//信息收集表单
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								$options = DiyForm::where('supplier_id', Admin::user()->id)->pluck('name', 'id'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								$form->select('diy_form_id', '信息收集表单')->options($options)->required(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								//扩展字段
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								$publish_type = array_intersect_key( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									admin_trans('product.options.publish_type'), | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |