belongsTo('UploadFile', 'image_id', 'file_id'); } /** * @notes:批量插入回收图片记录 * @param int $orderId 回收ID * @param array $imageIds 图片ID集 * @return array|false * @author: wanghousheng */ public static function increased(int $orderId, array $imageIds) { $dataset = []; foreach ($imageIds as $imageId) { $dataset[] = [ 'image_id' => $imageId, 'order_id' => $orderId, 'store_id' => self::$storeId ]; } return (new static)->addAll($dataset); } }