setter
							parent
							
								
									67fd07d14a
								
							
						
					
					
						commit
						4b0e9ba960
					
				|  | @ -274,7 +274,7 @@ class Spu extends Base | |||
|     protected function validateSku($sku) | ||||
|     { | ||||
|         return $this->validateByApi($sku, [ | ||||
|             'stock'          => 'require|number|gt:0', | ||||
|             'stock'          => 'require|number|>=:0', | ||||
|             'original_price' => 'number', | ||||
|             'price'          => 'number', | ||||
|             'score'          => 'number', | ||||
|  |  | |||
|  | @ -542,8 +542,8 @@ class SpuRepository extends Repository | |||
|                 throw new RepositoryException('请填写库存'); | ||||
|             } | ||||
|             $spec['price'] = $spec['original_price'] ?? 0; | ||||
|             if (isset($spec['price']) && $spec['price'] <= 0) { | ||||
|                 throw new RepositoryException('规格价格必须大于0'); | ||||
|             if (isset($spec['price']) && $spec['price'] < 0) { | ||||
|                 throw new RepositoryException('规格价格必须大于等于0'); | ||||
|             } | ||||
| 
 | ||||
|             if (!isset($spec['price']) && !isset($spec['score'])) { | ||||
|  |  | |||
|  | @ -1,10 +1,10 @@ | |||
| <IfModule mod_rewrite.c> | ||||
|    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 | ||||
|    Options +FollowSymlinks -Multiviews | ||||
|    RewriteEngine On | ||||
| 
 | ||||
|    RewriteCond %{REQUEST_FILENAME} !-d | ||||
|    RewriteCond %{REQUEST_FILENAME} !-f | ||||
|    RewriteCond %{REQUEST_URI} !^(.*)\.(gif|jpg|jpeg|png|swf|mp4)$ [NC] | ||||
|    RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L] | ||||
| <IfModule mod_rewrite.c> | ||||
|    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 | ||||
|    Options +FollowSymlinks -Multiviews | ||||
|    RewriteEngine On | ||||
| 
 | ||||
|    RewriteCond %{REQUEST_FILENAME} !-d | ||||
|    RewriteCond %{REQUEST_FILENAME} !-f | ||||
|    RewriteCond %{REQUEST_URI} !^(.*)\.(gif|jpg|jpeg|png|swf|mp4)$ [NC] | ||||
|    RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L] | ||||
|  </IfModule> | ||||
		Loading…
	
		Reference in New Issue