diff --git a/app/admin/view/default/pluginsadmin/save_info.html b/app/admin/view/default/pluginsadmin/save_info.html
index 3edeb261d..b0928f40c 100755
--- a/app/admin/view/default/pluginsadmin/save_info.html
+++ b/app/admin/view/default/pluginsadmin/save_info.html
@@ -11,14 +11,14 @@
diff --git a/app/api/controller/Ordernotify.php b/app/api/controller/Ordernotify.php
index 7e0e228e9..9e787bb28 100755
--- a/app/api/controller/Ordernotify.php
+++ b/app/api/controller/Ordernotify.php
@@ -46,7 +46,7 @@ class OrderNotify extends Common
public function Notify()
{
// 支付请求日志添加
- $log_ret = PayRequestLogService::PayRequestLogInsert(OrderService::$business_type_name);
+ $log_ret = PayRequestLogService::PayRequestLogInsert(OrderService::BusinessTypeName());
// 业务处理
$ret = OrderService::Notify($this->data_request);
diff --git a/app/lang/en-us.php b/app/lang/en-us.php
index b70795eb8..ec567486f 100644
--- a/app/lang/en-us.php
+++ b/app/lang/en-us.php
@@ -175,6 +175,10 @@ return [
'refund_success' => 'Refund Succeeded',
'refuse_fail' => 'Refuse Failed',
'refuse_success' => 'Refuse Succeeded',
+ 'delivery_fail' => 'Delivery Failed',
+ 'delivery_success' => 'Delivery Succeeded',
+ 'collect_fail' => 'Collect Failed',
+ 'collect_success' => 'Collect Succeeded',
'quit_success' => 'Quit Succeeded',
'no_data' => 'No Relevant Data',
'no_goods' => 'No related Goods',
@@ -204,7 +208,9 @@ return [
'config_error_tips' => 'Incorrect configuration',
'data_no_exist_error_tips' => 'Data does not exist',
'data_no_exist_or_delete_error_tips' => 'Data does not exist or has been deleted',
+ 'order_no_exist_or_delete_error_tips' => 'The order does not exist or has been deleted',
'goods_no_exist_or_delete_error_tips' => 'Item does not exist or has been deleted',
+ 'goods_empty_or_format_error_tips' => 'Item is empty or formatted incorrectly',
'no_filled_tips' => 'Not filled in',
'no_power_tips' => 'No permission',
'not_open_developer_mode_tips' => 'Please start developer mode first',
@@ -217,6 +223,7 @@ return [
'goods_id_error_tips' => 'Wrong goods ID',
'gods_info_incorrect_tips' => 'Incorrect goods information',
'gods_info_abnormal_tips' => 'Abnormal goods information',
+ 'order_no_error_tips' => 'Wrong order number',
'order_id_error_tips' => 'Wrong order ID',
'order_info_incorrect_tips' => 'The order information is incorrect',
'order_detail_id_error_tips' => 'The order detail id is incorrect',
@@ -226,6 +233,8 @@ return [
'back_prev_time_auto_text' => 'Second automatic return',
'view_config_course_name' => 'View the configuration tutorial',
'payment_method_error_tips' => 'Incorrect payment method',
+ 'payment_method_no_exist_tips' => 'Payment method does not exist',
+ 'payment_method_undefined_tips' => 'Payment method is not defined',
'operate_field_error_tips' => 'Operation field error',
'project_copy_fail_tips' => 'Package copy failed',
'operate_type_error_tips' => 'Wrong operate type',
@@ -233,6 +242,7 @@ return [
'status_not_can_operate_tips' => 'Status is inoperable',
'order_status_not_can_operate_tips' => 'Order status is inoperable',
'data_status_not_can_operate_tips' => 'Data status is inoperable',
+ 'plugins_config_error_tips' => 'Incorrect plug-in configuration',
// 商店
'store_bind_account_name' => 'Bind ShopXO store account',
'store_bind_account_tips' => 'If it is bound, please clear the cache under the menu tool on the left side of the mall background and try to access it again!',
@@ -250,6 +260,7 @@ return [
'back_home_title' => 'Back Home',
'shop_home_title' => 'Shop Home',
'home_title' => 'Home',
+ 'system_title' => 'System',
'operate_title' => 'Operate',
'all_title' => 'All',
'select_all_title' => 'All',
@@ -568,23 +579,6 @@ return [
'uninstall_confirm_tips' => 'It cannot be recovered after uninstallation. Are you sure to continue?',
'collect_confirm_tips' => 'Please carefully confirm that the goods have been received and confirm to continue?',
'save_close_page_confirm_tips' => 'Are you sure you want to save the data and continue to close this page?',
- // 订单状态进度
- 'order_status_setp_data' => [
- 'add' => 'Take Merchandise',
- 'cancel' => 'Order Cancel',
- 'close' => 'Order Close',
- 'pay' => 'Payment',
- 'delivery' => 'Seller Delivery',
- 'collect' => 'Confirm Receipt',
- 'comments' => 'Comments',
- ],
- // 订单售后
- 'orderaftersale_create_title_data' => [
- 'default' => 'Refund/Return',
- 'collect' => 'Apply Aftersale',
- 'step' => 'View Progress',
- 'success' => 'View Refund',
- ],
// 缓存更新类型列表
'admin_cache_type_list' => [
'site' => ['name' => 'Site Cache', 'desc' => 'This function can be used to update all caches after data conversion or when the foreground cannot be accessed normally'],
@@ -1176,7 +1170,7 @@ return [
'order_address_insert_fail_tips' => 'Failed to add order address',
'order_data_error_tips' => 'The order data is incorrect',
'order_detail_data_error_tips' => 'Incorrect order details',
- 'order_inventory_dec_type_error_tips' => 'Wrong order operation type',
+ 'order_inventory_dec_type_error_tips' => 'Wrong inventory deduction operation type',
'inventory_dec_not_enable_tips' => 'Deduction inventory not opened',
'inventory_dec_not_confirm_tips' => 'The current order status has not been confirmed - do not deduct inventory',
'inventory_dec_not_pay_tips' => 'The current order status has not been operated for payment - do not deduct inventory',
@@ -1497,6 +1491,7 @@ return [
'delete_warehouse_goods_fail_tips' => 'Failed to delete warehouse goods',
'delete_warehouse_goods_spec_fail_tips' => 'Failed to delete warehouse goods inventory',
// 基础
+ 'base_goods_spec_default_name' => 'Default Spec',
'base_spec_not_choice_tips' => 'Please select a specification',
'base_spec_empty_tips' => 'No relevant specifications',
'base_spec_type_empty_tips' => 'No relevant specification type',
@@ -1727,6 +1722,216 @@ return [
'ordercurrency' => [
'order_currency_insert_fail_tips' => 'Failed to add order currency',
],
+ // 订单
+ 'order' => [
+ // 业务类型名称
+ 'business_type_name' => 'Order',
+ // 基础
+ 'order_user_invalid_tips' => 'Invalid order user',
+ 'pay_api_abnormal_tips' => 'Abnormal payment interface',
+ 'pay_subject_name' => 'Order payment',
+ 'pay_params_error_tips' => 'Payment transfer parameter error',
+ 'pay_price_error_tips' => 'The order amount is incorrect, please initiate payment normally',
+ 'only_under_line_error_tips' => 'Only offline payment method processing',
+ 'order_pay_user_message_msg' => 'The order was paid successfully, with the amount of {:price} yuan',
+ 'order_update_fail_tips' => 'Order update failed',
+ 'user_under_line_pay_history_desc' => 'User offline payment',
+ 'order_status_history_insert_fail_tips' => 'Failed to add order log',
+ 'order_status_history_update_fail_tips' => 'Log order update failed',
+ 'order_submit_await_confirm_tips' => 'Submitted successfully, please contact the administrator to confirm the payment information as soon as possible',
+ 'pay_log_already_pay_tips' => 'The log order has been paid without repeated processing',
+ 'pay_price_less_than_order_price_tips' => 'The payment amount is less than the log order amount',
+ 'pay_log_error_tips' => 'Payment log order error',
+ 'pay_log_value_error_tips' => 'The payment log order associated information is incorrect',
+ 'order_data_empty_or_format_error_tips' => 'The order data does not exist or the type is incorrect',
+ 'order_take_status_name' => 'To be picked up',
+ 'order_under_line_pay_status_name' => 'To be confirmed',
+ 'order_under_line_name' => 'Offline payment',
+ 'order_item_summary_desc' => '共{:buy_number_count}件 合计:{:currency_symbol}{:total_price}元',
+ 'order_goods_sales_count_inc_fail_tips' => 'Failed to increase sales volume of order goods',
+ 'order_detail_goods_empty_tips' => 'There is an error in the order. No related products were found',
+ 'pay_have_in_hand_tips' => 'In payment',
+ // 取消
+ 'order_cancel_message_data' => [
+ 'title' => 'Order cancel',
+ 'desc' => 'Order canceled successfully',
+ ],
+ // 发货/取货
+ 'delivery_express_id_message' => 'Incorrect delivery method',
+ 'delivery_express_number_message' => 'Incorrect express order number',
+ 'take_extraction_code_message' => 'Wrong pickup code',
+ 'take_extraction_code_empty_tips' => 'The order pickup code does not exist. Please contact the administrator',
+ 'take_extraction_code_error_tips' => 'Incorrect pickup code',
+ 'order_delivery_message_data' => [
+ 'title' => 'Order shipment',
+ 'desc' => 'Order shipped',
+ ],
+ // 收货
+ 'order_collect_message_data' => [
+ 'title' => 'Order receipt',
+ 'desc' => 'Order received successfully',
+ ],
+ // 确认
+ 'order_confirm_message_data' => [
+ 'title' => 'Order confirmed',
+ 'desc' => 'Order confirmed successfully',
+ ],
+ // 删除
+ 'order_delete_message_data' => [
+ 'title' => 'Order delete',
+ 'desc' => 'Order deleted successfully',
+ ],
+ // 订单状态进度
+ 'order_status_setp_data' => [
+ 'add' => 'Take Merchandise',
+ 'cancel' => 'Order Cancel',
+ 'close' => 'Order Close',
+ 'pay' => 'Payment',
+ 'delivery' => 'Seller Delivery',
+ 'collect' => 'Confirm Receipt',
+ 'comments' => 'Comments',
+ ],
+ // 订单售后
+ 'orderaftersale_create_title_data' => [
+ 'default' => 'Refund/Return',
+ 'collect' => 'Apply Aftersale',
+ 'step' => 'View Progress',
+ 'success' => 'View Refund',
+ ],
+ ],
+ // 软件安装服务
+ 'packageinstall' => [
+ 'package_no_exist_tips' => 'The software package does not exist, please reinstall',
+ 'mini_theme_terminal_not_choice_tips' => 'Applet terminal type not specified',
+ 'download_url_empty_tips' => 'The download address is empty',
+ 'plugins_type_error_tips' => 'Wrong plug-in type',
+ 'operate_key_error_tips' => 'Incorrect operation key',
+ 'store_respond_error_tips' => 'The store responded incorrectly',
+ ],
+ // 支付日志
+ 'paylog' => [
+ 'save_user_id_empty_tips' => 'User ID is empty',
+ 'save_business_type_empty_tips' => 'Business type is empty',
+ 'save_business_ids_format_tips' => 'Wrong business ID data type',
+ 'save_total_price_error_tips' => 'Incorrect business amount',
+ 'pay_log_insert_fail_tips' => 'Failed to add payment order',
+ 'pay_log_id_empty_tips' => 'The log ID is incorrect',
+ 'pay_log_update_fail_tips' => 'Log order update failed',
+ ],
+ // 支付方式
+ 'payment' => [
+ // 表单
+ 'form_item_name' => 'Name',
+ 'form_item_name_message' => 'Name format 2~30 characters',
+ 'form_item_apply_terminal' => 'Applicable Terminal',
+ 'form_item_apply_terminal_message' => 'Select at least one applicable terminal',
+ 'form_item_logo' => 'LOGO',
+ 'form_item_is_open_user' => 'Open to Users',
+ // 生成
+ 'create_payment_empty_tips' => 'Payment unique mark cannot be empty',
+ 'create_respond_empty_tips' => 'Payment synchronization address parameter cannot be empty',
+ 'create_notify_empty_tips' => 'The payment asynchronous address parameter cannot be empty',
+ // 基础
+ 'dir_no_power_tips' => 'Directory does not have operation permission',
+ 'upload_success_tips' => 'Upload succeeded [{:success} payment plug-ins succeeded, {:error} invalid files failed]',
+ 'upload_fail_tips' => 'Upload failed. {:error} invalid files, such as function plug-ins, please upload and install them in the [Application Center ->Application Management] module',
+ 'payment_not_allow_delete_tips' => 'This payment method cannot be deleted',
+ 'file_no_power_tips' => 'No operation permission',
+ 'pay_respond_file_no_exist_tips' => 'The payment return entry file does not exist. Please contact the administrator for processing',
+ 'pay_notify_file_no_exist_tips' => 'The payment notification entry file does not exist. Please contact the administrator for processing',
+ 'no_plugins_data_tips' => 'No plug-in data',
+ ],
+ // 支付请求日志
+ 'payrequestlog' => [
+ 'save_business_type_empty_tips' => 'Business type is empty',
+ 'pay_request_log_insert_fail_tips' => 'Failed to add payment request log',
+ 'pay_request_log_update_fail_tips' => 'Payment request log update failed',
+ ],
+ // 插件管理
+ 'pluginsadmin' => [
+ // 表单
+ 'form_item_upload_tips' => 'Upload an application installation package in zip compression format',
+ 'form_create_error_tips' => 'Please fill in again!',
+ 'form_create_first_step_button_name' => 'Next Step',
+ 'form_item_plugins' => 'Apply unique tags',
+ 'form_item_plugins_tips' => 'Use numbers, lowercase letters and underscores',
+ 'form_item_plugins_message' => 'Apply unique tag format of 2~60 characters',
+ 'form_item_logo' => 'LOGO',
+ 'form_item_logo_tips' => '600 * 600px proposal',
+ 'form_item_name' => 'Name',
+ 'form_item_name_message' => 'Name format: 2~30 characters',
+ 'form_item_author' => 'Author',
+ 'form_item_author_message' => 'Author format 2~30 characters',
+ 'form_item_author_url' => 'Author URI',
+ 'form_item_author_url_tips' => 'Start with http://or https://',
+ 'form_item_author_url_message' => 'Please fill in the authors homepage',
+ 'form_item_version' => 'Version',
+ 'form_item_version_tips' => 'Major version, minor version number and revision number, each segment shall not exceed 6 digits, such as 1.0.0',
+ 'form_item_version_message' => 'Incorrect version format',
+ 'form_item_desc' => 'Describe',
+ 'form_item_desc_message' => 'Description content format: 2~60 characters',
+ 'form_item_apply_terminal' => 'Applicable Terminal',
+ 'form_item_apply_terminal_message' => 'Select at least one applicable terminal',
+ 'form_item_apply_version' => 'Applicable system version',
+ 'form_item_apply_version_message' => 'Select at least one applicable system version',
+ 'form_item_is_home' => 'Whether there is front-end entrance',
+ 'form_item_is_home_tips' => 'Front independent page entry',
+ // 保存
+ 'app_dir_create_fial_tips' => 'App home directory creation failed',
+ 'app_file_create_fail_tips' => 'Application file creation failed',
+ 'app_static_dir_create_fail_tips' => 'Application static directory creation failed',
+ 'app_static_file_create_fail_tips' => 'Application static file creation failed',
+ 'app_admin_dir_create_fail_tips' => 'Application backend directory creation failed',
+ 'app_home_dir_create_fail_tips' => 'App front-end directory creation failed',
+ 'app_view_dir_create_fail_tips' => 'Failed to create the application view directory',
+ 'app_view_file_create_fail_tips' => 'Application view file creation failed',
+ 'app_config_no_power_tips' => 'The application profile does not have operation Application profile creation failed',
+ 'app_config_create_tail_tips' => 'Application profile creation failed',
+ 'app_name_exclude_tips' => 'Cannot use restricted name',
+ // 操作权限
+ 'app_dir_no_power_tips' => 'The application directory does not have operation permissions',
+ 'app_view_dir_no_power_tips' => 'The application view directory does not have operation permissions',
+ 'app_css_dir_no_power_tips' => 'The application css directory does not have operation permissions',
+ 'app_js_dir_no_power_tips' => 'The application js directory does not have operation permissions',
+ 'app_images_dir_no_power_tips' => 'The application images directory does not have operation permissions',
+ 'app_upload_dir_no_power_tips' => 'The application upload directory does not have operation permissions',
+ // 基础
+ 'file_no_power_tips' => 'File does not have permission',
+ 'dir_no_power_tips' => 'Directory operation permissions',
+ 'app_deployment_fail_tips' => 'Application hook deployment failed',
+ 'app_no_exist_tips' => 'App does not exist',
+ 'please_uninstall_tips' => 'Please uninstall the app first',
+ 'app_name_exist_tips' => 'App name already exists',
+ 'app_name_appoint_error_tips' => 'The application ID is inconsistent with the specified',
+ 'plugins_package_empty_tips' => 'Wrong plug-in package',
+ 'plugins_package_error_tips' => 'Please upload and install the payment plug-in in the [Website Management ->Payment Method] module',
+ 'plugins_package_invalid_tips' => 'Invalid plug-in package',
+ 'plugins_identification_error_tips' => 'Wrong plug-in identification',
+ 'plugins_identification_empty_tips' => 'Plug-in ID is empty',
+ 'plugins_copy_control_fail_tips' => 'controller',
+ 'plugins_copy_view_fail_tips' => 'view',
+ 'plugins_new_config_error_tips' => 'The new configuration file is incorrect',
+ 'plugins_new_config_update_fail_tips' => 'Failed to update the new app profile',
+ 'app_update_no_exist_tips' => 'The application does not exist [{:plugins}]. Please install it first',
+ 'sort_save_data_empty_tips' => 'No plug-in data to save',
+ 'sort_save_data_error_tips' => 'The plug-in sorting data is incorrect',
+ ],
+ // 插件服务
+ 'plugins' => [
+ 'plugins_identification_empty_tips' => 'Application tag cannot be empty',
+ 'data_params_empty_tips' => 'Data parameter cannot be empty',
+ 'plugins_invalid_tips' => 'Invalid plug-in',
+ 'plugins_not_install_tips' => 'App not installed',
+ 'plugins_not_enable_tips' => 'App not enabled',
+ 'plugins_call_control_undefined_tips' => 'Application controller is not defined',
+ 'plugins_call_action_undefined_tips' => 'Application method is not defined',
+ 'plugins_call_config_error_tips' => 'Incorrect application configuration information',
+ 'plugins_event_undefined_tips' => 'Application event is not defined',
+ 'plugins_event_action_undefined_tips' => 'Application event method is not defined',
+ 'plugins_no_data_tips' => 'No plug-in data',
+ 'plugins_new_version_update_tips' => '({:plugins} v{:version})The plug-in has a new version to be updated',
+ 'plugins_no_update_tips' => 'No plug-ins need to be updated',
+ ],
],
// -------------------- 公共 --------------------
diff --git a/app/lang/zh-cn.php b/app/lang/zh-cn.php
index e32b6a81c..2de0591a8 100755
--- a/app/lang/zh-cn.php
+++ b/app/lang/zh-cn.php
@@ -175,6 +175,10 @@ return [
'refund_success' => '退款成功',
'refuse_fail' => '拒绝失败',
'refuse_success' => '拒绝成功',
+ 'delivery_fail' => '发货失败',
+ 'delivery_success' => '发货成功',
+ 'collect_fail' => '收货失败',
+ 'collect_success' => '收货成功',
'quit_success' => '退出成功',
'no_data' => '没有相关数据',
'no_goods' => '没有相关商品',
@@ -204,7 +208,9 @@ return [
'config_error_tips' => '配置有误',
'data_no_exist_error_tips' => '数据不存在',
'data_no_exist_or_delete_error_tips' => '数据不存在或已删除',
+ 'order_no_exist_or_delete_error_tips' => '订单不存在或已删除',
'goods_no_exist_or_delete_error_tips' => '商品不存在或已删除',
+ 'goods_empty_or_format_error_tips' => '商品为空或格式错误',
'no_filled_tips' => '未填写',
'no_power_tips' => '无权限',
'not_open_developer_mode_tips' => '请先开启开发者模式',
@@ -217,15 +223,18 @@ return [
'goods_id_error_tips' => '商品id有误',
'gods_info_incorrect_tips' => '商品信息有误',
'gods_info_abnormal_tips' => '商品信息异常',
+ 'order_no_error_tips' => '订单号有误',
'order_id_error_tips' => '订单id有误',
'order_info_incorrect_tips' => '订单信息有误',
- 'order_detail_id_error_tips' => '订单id有误',
- 'order_detail_info_incorrect_tips' => '订单信息有误',
+ 'order_detail_id_error_tips' => '订单详情id有误',
+ 'order_detail_info_incorrect_tips' => '订单详情信息有误',
'data_id_error_tips' => '数据id有误',
'back_prev_page_name' => '返回上一页',
'back_prev_time_auto_text' => '秒自动返回',
'view_config_course_name' => '查看配置教程',
'payment_method_error_tips' => '支付方式有误',
+ 'payment_method_no_exist_tips' => '支付方式不存在',
+ 'payment_method_undefined_tips' => '支付方式未定义',
'operate_field_error_tips' => '操作字段有误',
'project_copy_fail_tips' => '项目包复制失败',
'operate_type_error_tips' => '操作类型有误',
@@ -233,6 +242,7 @@ return [
'status_not_can_operate_tips' => '状态不可操作',
'order_status_not_can_operate_tips' => '订单状态不可操作',
'data_status_not_can_operate_tips' => '数据状态不可操作',
+ 'plugins_config_error_tips' => '插件配置有误',
// 商店
'store_bind_account_name' => '绑定ShopXO商店账户',
'store_bind_account_tips' => '如已绑定、请到商城后台左侧菜单工具下面清除缓存再尝试访问!',
@@ -250,6 +260,7 @@ return [
'back_home_title' => '回到首页',
'shop_home_title' => '商城首页',
'home_title' => '首页',
+ 'system_title' => '系统',
'operate_title' => '操作',
'all_title' => '全部',
'select_all_title' => '全选',
@@ -568,24 +579,6 @@ return [
'uninstall_confirm_tips' => '卸载后不可恢复、确认继续吗?',
'collect_confirm_tips' => '确认已收到货物、操作后不可恢复!',
'save_close_page_confirm_tips' => '请确认数据是否保存、继续关闭本页吗?',
-
- // 订单状态进度
- 'order_status_setp_data' => [
- 'add' => '拍下商品',
- 'cancel' => '订单取消',
- 'close' => '订单关闭',
- 'pay' => '付款',
- 'delivery' => '卖家发货',
- 'collect' => '确认收货',
- 'comments' => '评价',
- ],
- // 订单售后
- 'orderaftersale_create_title_data' => [
- 'default' => '退款/退货',
- 'collect' => '申请售后',
- 'step' => '查看进度',
- 'success' => '查看退款',
- ],
// 缓存更新类型列表
'admin_cache_type_list' => [
'site' => ['name' => '站点缓存', 'desc' => '数据转换后或前台不能正常访问时,可以使用此功能更新所有缓存'],
@@ -1181,7 +1174,7 @@ return [
'order_address_insert_fail_tips' => '订单地址添加失败',
'order_data_error_tips' => '订单数据有误',
'order_detail_data_error_tips' => '订单详情数据有误',
- 'order_inventory_dec_type_error_tips' => '订单操作类型有误',
+ 'order_inventory_dec_type_error_tips' => '库存扣减操作类型有误',
'inventory_dec_not_enable_tips' => '未开启扣除库存',
'inventory_dec_not_confirm_tips' => '当前订单状态未操作确认-不扣除库存',
'inventory_dec_not_pay_tips' => '当前订单状态未操作支付-不扣除库存',
@@ -1503,6 +1496,7 @@ return [
'delete_warehouse_goods_fail_tips' => '仓库商品删除失败',
'delete_warehouse_goods_spec_fail_tips' => '仓库商品库存删除失败',
// 基础
+ 'base_goods_spec_default_name' => '默认规格',
'base_spec_not_choice_tips' => '请选择规格',
'base_spec_empty_tips' => '没有相关规格',
'base_spec_type_empty_tips' => '没有相关规格类型',
@@ -1733,6 +1727,217 @@ return [
'ordercurrency' => [
'order_currency_insert_fail_tips' => '订单货币新增失败',
],
+ // 订单
+ 'order' => [
+ // 业务类型名称
+ 'business_type_name' => '订单',
+ // 基础
+ 'order_user_invalid_tips' => '订单用户无效',
+ 'pay_api_abnormal_tips' => '支付接口异常',
+ 'pay_subject_name' => '订单支付',
+ 'pay_params_error_tips' => '支付传参有误',
+ 'pay_price_error_tips' => '订单金额有误、请正常发起支付',
+ 'only_under_line_error_tips' => '仅线下支付方式处理',
+ 'order_pay_user_message_msg' => '订单支付成功,金额{:price}元',
+ 'order_update_fail_tips' => '订单更新失败',
+ 'user_under_line_pay_history_desc' => '用户线下支付',
+ 'order_status_history_insert_fail_tips' => '订单日志添加失败',
+ 'order_status_history_update_fail_tips' => '日志订单更新失败',
+ 'order_submit_await_confirm_tips' => '提交成功、请尽快联系管理员确认支付信息',
+ 'pay_log_already_pay_tips' => '日志订单已支付、无需重复处理',
+ 'pay_price_less_than_order_price_tips' => '支付金额小于日志订单金额',
+ 'pay_log_error_tips' => '支付日志订单有误',
+ 'pay_log_value_error_tips' => '支付日志订单关联信息有误',
+ 'order_data_empty_or_format_error_tips' => '订单数据不存在或类型有误',
+ 'order_take_status_name' => '待取货',
+ 'order_under_line_pay_status_name' => '待确认',
+ 'order_under_line_name' => '线下支付',
+ 'order_item_summary_desc' => '共{:buy_number_count}件 合计:{:currency_symbol}{:total_price}元',
+ 'order_goods_sales_count_inc_fail_tips' => '订单商品销量增加失败',
+ 'order_detail_goods_empty_tips' => '订单有误,没有找到相关商品',
+ 'pay_have_in_hand_tips' => '支付中',
+ // 取消
+ 'order_cancel_message_data' => [
+ 'title' => '订单取消',
+ 'desc' => '订单取消成功',
+ ],
+ // 发货/取货
+ 'delivery_express_id_message' => '快递方式有误',
+ 'delivery_express_number_message' => '快递单号有误',
+ 'take_extraction_code_message' => '取货码有误',
+ 'take_extraction_code_empty_tips' => '订单取货码不存在、请联系管理员',
+ 'take_extraction_code_error_tips' => '取货码不正确',
+ 'order_delivery_message_data' => [
+ 'title' => '订单发货',
+ 'desc' => '订单已发货',
+ ],
+ // 收货
+ 'order_collect_message_data' => [
+ 'title' => '订单收货',
+ 'desc' => '订单收货成功',
+ ],
+ // 确认
+ 'order_confirm_message_data' => [
+ 'title' => '订单确认',
+ 'desc' => '订单确认成功',
+ ],
+ // 删除
+ 'order_delete_message_data' => [
+ 'title' => '订单删除',
+ 'desc' => '订单删除成功',
+ ],
+ // 订单状态进度
+ 'order_status_setp_data' => [
+ 'add' => '拍下商品',
+ 'cancel' => '订单取消',
+ 'close' => '订单关闭',
+ 'pay' => '付款',
+ 'delivery' => '卖家发货',
+ 'collect' => '确认收货',
+ 'comments' => '评价',
+ ],
+ // 订单售后
+ 'orderaftersale_create_title_data' => [
+ 'default' => '退款/退货',
+ 'collect' => '申请售后',
+ 'step' => '查看进度',
+ 'success' => '查看退款',
+ ],
+ ],
+ // 软件安装服务
+ 'packageinstall' => [
+ 'package_no_exist_tips' => '软件包不存在、请重新安装',
+ 'mini_theme_terminal_not_choice_tips' => '未指定小程序终端类型',
+ 'download_url_empty_tips' => '下载地址为空',
+ 'plugins_type_error_tips' => '插件类型有误',
+ 'operate_key_error_tips' => '操作key有误',
+ 'store_respond_error_tips' => '商店响应有误',
+ ],
+ // 支付日志
+ 'paylog' => [
+ 'save_user_id_empty_tips' => '用户id为空',
+ 'save_business_type_empty_tips' => '业务类型为空',
+ 'save_business_ids_format_tips' => '业务id数据类型有误',
+ 'save_total_price_error_tips' => '业务金额有误',
+ 'pay_log_insert_fail_tips' => '支付订单添加失败',
+ 'pay_log_id_empty_tips' => '日志id有误',
+ 'pay_log_update_fail_tips' => '日志订单更新失败',
+ ],
+ // 支付方式
+ 'payment' => [
+ // 表单
+ 'form_item_name' => '名称',
+ 'form_item_name_message' => '名称格式2~30个字符',
+ 'form_item_apply_terminal' => '适用终端',
+ 'form_item_apply_terminal_message' => '至少选择一个适用终端',
+ 'form_item_logo' => 'LOGO',
+ 'form_item_is_open_user' => '用户开放',
+ // 生成
+ 'create_payment_empty_tips' => '支付唯一标记不能为空',
+ 'create_respond_empty_tips' => '支付同步地址参数不能为空',
+ 'create_notify_empty_tips' => '支付异步地址参数不能为空',
+ // 基础
+ 'dir_no_power_tips' => '目录没有操作权限',
+ 'upload_success_tips' => '上传成功[成功{:success}个支付插件, 失败{:error}个无效文件]',
+ 'upload_fail_tips' => '上传失败,{:error}个无效文件、如功能插件请到[ 应用中心->应用管理 ]模块里面去上传安装',
+ 'payment_not_allow_delete_tips' => '该支付方式禁止删除',
+ 'file_no_power_tips' => '没操作权限',
+ 'pay_respond_file_no_exist_tips' => '支付返回入口文件不存在,请联系管理员处理',
+ 'pay_notify_file_no_exist_tips' => '支付通知入口文件不存在,请联系管理员处理',
+ 'no_plugins_data_tips' => '无插件数据',
+ ],
+ // 支付请求日志
+ 'payrequestlog' => [
+ 'save_business_type_empty_tips' => '业务类型为空',
+ 'pay_request_log_insert_fail_tips' => '支付请求日志添加失败',
+ 'pay_request_log_update_fail_tips' => '支付请求日志更新失败',
+ ],
+ // 插件管理
+ 'pluginsadmin' => [
+ // 表单
+ 'form_item_upload_tips' => '上传一个zip压缩格式的应用安装包',
+ 'form_create_error_tips' => '请重新填写!',
+ 'form_create_first_step_button_name' => '下一步',
+ 'form_item_plugins' => '应用唯一标记',
+ 'form_item_plugins_tips' => '以数字、字母小写、下划线',
+ 'form_item_plugins_message' => '应用唯一标记格式2~60个字符',
+ 'form_item_logo' => 'LOGO',
+ 'form_item_logo_tips' => '建议600*600px',
+ 'form_item_logo_message' => '请上传LOGO',
+ 'form_item_name' => '名称',
+ 'form_item_name_message' => '名称格式2~30个字符',
+ 'form_item_author' => '作者',
+ 'form_item_author_message' => '作者格式2~30个字符',
+ 'form_item_author_url' => '作者主页',
+ 'form_item_author_url_tips' => '以http://或https://开头',
+ 'form_item_author_url_message' => '请填写作者主页',
+ 'form_item_version' => '版本',
+ 'form_item_version_tips' => '主版本.次版本号.修订号,每个段不超过6位,如 1.0.0',
+ 'form_item_version_message' => '版本格式有误',
+ 'form_item_desc' => '描述',
+ 'form_item_desc_message' => '描述内容格式2~60个字符',
+ 'form_item_apply_terminal' => '适用终端',
+ 'form_item_apply_terminal_message' => '至少选择一个适用终端',
+ 'form_item_apply_version' => '适用系统版本',
+ 'form_item_apply_version_message' => '至少选择一个适用系统版本',
+ 'form_item_is_home' => '是否有前端入口',
+ 'form_item_is_home_tips' => '前端独立页面入口',
+ // 保存
+ 'app_dir_create_fial_tips' => '应用主目录创建失败',
+ 'app_file_create_fail_tips' => '应用文件创建失败',
+ 'app_static_dir_create_fail_tips' => '应用静态目录创建失败',
+ 'app_static_file_create_fail_tips' => '应用静态文件创建失败',
+ 'app_admin_dir_create_fail_tips' => '应用后端目录创建失败',
+ 'app_home_dir_create_fail_tips' => '应用前端目录创建失败',
+ 'app_view_dir_create_fail_tips' => '应用视图目录创建失败',
+ 'app_view_file_create_fail_tips' => '应用视图文件创建失败',
+ 'app_config_no_power_tips' => '应用配置文件没有操作权限',
+ 'app_config_create_tail_tips' => '应用配置文件创建失败',
+ 'app_name_exclude_tips' => '不能使用限制的名称',
+ // 操作权限
+ 'app_dir_no_power_tips' => '应用目录没有操作权限',
+ 'app_view_dir_no_power_tips' => '应用视图目录没有操作权限',
+ 'app_css_dir_no_power_tips' => '应用css目录没有操作权限',
+ 'app_js_dir_no_power_tips' => '应用js目录没有操作权限',
+ 'app_images_dir_no_power_tips' => '应用images目录没有操作权限',
+ 'app_upload_dir_no_power_tips' => '应用upload目录没有操作权限',
+ // 基础
+ 'file_no_power_tips' => '文件没有权限',
+ 'dir_no_power_tips' => '目录操作权限',
+ 'app_deployment_fail_tips' => '应用钩子部署失败',
+ 'app_no_exist_tips' => '应用不存在',
+ 'please_uninstall_tips' => '请先卸载应用',
+ 'app_name_exist_tips' => '应用名称已存在',
+ 'app_name_appoint_error_tips' => '应用标识与指定不一致',
+ 'plugins_package_empty_tips' => '插件包有误',
+ 'plugins_package_error_tips' => '支付插件请到[ 网站管理->支付方式 ]模块里面去上传安装',
+ 'plugins_package_invalid_tips' => '无效的插件包',
+ 'plugins_identification_error_tips' => '插件标识有误',
+ 'plugins_identification_empty_tips' => '插件标识为空',
+ 'plugins_copy_control_fail_tips' => '控制器',
+ 'plugins_copy_view_fail_tips' => '视图',
+ 'plugins_new_config_error_tips' => '新配置文件有误',
+ 'plugins_new_config_update_fail_tips' => '新应用配置文件更新失败',
+ 'app_update_no_exist_tips' => '应用不存在[{:plugins}]、请先安装',
+ 'sort_save_data_empty_tips' => '没有可保存的插件数据',
+ 'sort_save_data_error_tips' => '插件排序数据有误',
+ ],
+ // 插件服务
+ 'plugins' => [
+ 'plugins_identification_empty_tips' => '应用标记不能为空',
+ 'data_params_empty_tips' => '数据参数不能为空',
+ 'plugins_invalid_tips' => '无效插件',
+ 'plugins_not_install_tips' => '应用未安装',
+ 'plugins_not_enable_tips' => '应用未启用',
+ 'plugins_call_control_undefined_tips' => '应用控制器未定义',
+ 'plugins_call_action_undefined_tips' => '应用方法未定义',
+ 'plugins_call_config_error_tips' => '应用配置信息有误',
+ 'plugins_event_undefined_tips' => '应用事件未定义',
+ 'plugins_event_action_undefined_tips' => '应用事件方法未定义',
+ 'plugins_no_data_tips' => '无插件数据',
+ 'plugins_new_version_update_tips' => '({:plugins} v{:version})插件有新版本待更新',
+ 'plugins_no_update_tips' => '无需要更新的插件',
+ ],
],
// -------------------- 公共 --------------------
diff --git a/app/service/GoodsService.php b/app/service/GoodsService.php
index 3adede106..53a3649fb 100755
--- a/app/service/GoodsService.php
+++ b/app/service/GoodsService.php
@@ -34,6 +34,19 @@ class GoodsService
// 规格转成字符串分割符号
public static $goods_spec_to_string_separator = '{|}';
+ /**
+ * 商品规格默认名称
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2023-02-09
+ * @desc description
+ */
+ public static function GoodsSpecDefaultName()
+ {
+ return MyLang('common_service.goods.base_goods_spec_default_name');
+ }
+
/**
* 获取首页楼层数据
* @author Devil
diff --git a/app/service/OrderAftersaleService.php b/app/service/OrderAftersaleService.php
index 9a61fca2d..278018715 100644
--- a/app/service/OrderAftersaleService.php
+++ b/app/service/OrderAftersaleService.php
@@ -850,7 +850,7 @@ class OrderAftersaleService
}
// 订单支付方式校验
- $pay_log = Db::name('PayLog')->alias('pl')->join('pay_log_value plv', 'pl.id=plv.pay_log_id')->where(['plv.business_id'=>$order['data']['id'], 'pl.business_type'=>OrderService::$business_type_name, 'pl.status'=>1])->field('pl.*')->find();
+ $pay_log = Db::name('PayLog')->alias('pl')->join('pay_log_value plv', 'pl.id=plv.pay_log_id')->where(['plv.business_id'=>$order['data']['id'], 'pl.business_type'=>OrderService::BusinessTypeName(), 'pl.status'=>1])->field('pl.*')->find();
// 手动处理不校验支付日志
if($params['refundment'] != 2)
@@ -1164,7 +1164,7 @@ class OrderAftersaleService
'payment' => $pay_log['payment'],
'payment_name' => $pay_log['payment_name'],
'refundment' => $params['refundment'],
- 'business_type' => OrderService::$business_type_name,
+ 'business_type' => OrderService::BusinessTypeName(),
'return_params' => isset($ret['data']['return_params']) ? $ret['data']['return_params'] : '',
];
RefundLogService::RefundLogInsert($refund_log);
diff --git a/app/service/OrderService.php b/app/service/OrderService.php
index 9310184a4..dea69b155 100755
--- a/app/service/OrderService.php
+++ b/app/service/OrderService.php
@@ -34,8 +34,18 @@ use app\service\SystemService;
*/
class OrderService
{
- // 业务类型名称
- public static $business_type_name = '订单';
+ /**
+ * 业务类型名称
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2023-02-08
+ * @desc description
+ */
+ public static function BusinessTypeName()
+ {
+ return MyLang('common_service.order.business_type_name');
+ }
/**
* 订单支付
@@ -61,12 +71,11 @@ class OrderService
{
return DataReturn($ret, -1);
}
-
// 支付订单id
$ids = is_array($params['ids']) ? $params['ids'] : explode(',', urldecode($params['ids']));
if(empty($ids))
{
- return DataReturn('订单支付id有误', -1);
+ return DataReturn(MyLang('order_id_error_tips'), -1);
}
// 支付基础信息
@@ -84,7 +93,7 @@ class OrderService
$order = Db::name('Order')->where($where)->find();
if(empty($order))
{
- return DataReturn('订单不存在或已被删除', -1);
+ return DataReturn(MyLang('order_no_exist_or_delete_error_tips'), -1);
}
$operate = self::OrderOperateData($order, 'user');
if($operate['is_pay'] != 1)
@@ -101,7 +110,7 @@ class OrderService
$order['user'] = UserService::UserHandle(UserService::UserInfo('id', $order['user_id']));
if(empty($order['user']))
{
- return DataReturn('订单用户无效['.$order_id.']', -1);
+ return DataReturn(MyLang('common_service.order.order_user_invalid_tips').'['.$order_id.']', -1);
}
// 订单数据集合
@@ -272,7 +281,7 @@ class OrderService
'business_data' => $order_data,
'order_id' => $pay_log['data']['id'],
'order_no' => $pay_log['data']['log_no'],
- 'name' => '订单支付',
+ 'name' => MyLang('common_service.order.pay_subject_name'),
'total_price' => $total_price,
'client_type' => $client_type,
'notify_url' => $notify_url,
@@ -373,7 +382,7 @@ class OrderService
return $ret;
}
return DataReturn(
- empty($ret['msg']) ? '支付接口异常' : $ret['msg'],
+ empty($ret['msg']) ? MyLang('common_service.order.pay_api_abnormal_tips') : $ret['msg'],
isset($ret['code']) ? $ret['code'] : -1,
isset($ret['data']) ? $ret['data'] : '');
}
@@ -396,10 +405,10 @@ class OrderService
'business_ids' => is_array($business_ids) ? $business_ids : [$business_ids],
'business_nos' => is_array($business_nos) ? $business_nos : [$business_nos],
'total_price' => isset($params['total_price']) ? PriceNumberFormat($params['total_price']) : 0.00,
- 'subject' => '订单支付',
+ 'subject' => MyLang('common_service.order.pay_subject_name'),
'payment' => isset($params['payment']) ? $params['payment'] : '',
'payment_name' => isset($params['payment_name']) ? $params['payment_name'] : '',
- 'business_type' => self::$business_type_name,
+ 'business_type' => self::BusinessTypeName(),
]);
}
@@ -461,7 +470,7 @@ class OrderService
$user = UserService::GetUserViewInfo($order['user_id']);
if(empty($user))
{
- return DataReturn('订单用户无效', -1);
+ return DataReturn(MyLang('common_service.order.order_user_invalid_tips'), -1);
}
// 线下支付处理
@@ -495,16 +504,16 @@ class OrderService
'pay_log_data' => [],
'pay' => [
'trade_no' => '',
- 'subject' => isset($params['params']['subject']) ? $params['params']['subject'] : '订单支付',
+ 'subject' => isset($params['params']['subject']) ? $params['params']['subject'] : MyLang('common_service.order.pay_subject_name'),
'buyer_user' => $params['user']['user_name_view'],
'pay_price' => $params['order']['total_price'],
],
];
return self::OrderPayHandle($pay_params);
}
- return DataReturn('订单金额有误、请正常发起支付', -1);
+ return DataReturn(MyLang('common_service.order.pay_price_error_tips'), -1);
}
- return DataReturn('支付传参有误', -1);
+ return DataReturn(MyLang('common_service.order.pay_params_error_tips'), -1);
}
/**
@@ -543,16 +552,16 @@ class OrderService
'pay_log_data' => $pay_log['data'],
'pay' => [
'trade_no' => '',
- 'subject' => isset($params['params']['subject']) ? $params['params']['subject'] : '订单支付',
+ 'subject' => isset($params['params']['subject']) ? $params['params']['subject'] : MyLang('common_service.order.pay_subject_name'),
'buyer_user' => $params['user']['user_name_view'],
'pay_price' => $params['order']['total_price'],
],
];
return self::OrderPayHandle($pay_params);
}
- return DataReturn('仅线下支付方式处理', -1);
+ return DataReturn(MyLang('common_service.order.only_under_line_error_tips'), -1);
}
- return DataReturn('支付传参有误', -1);
+ return DataReturn(MyLang('common_service.order.pay_params_error_tips'), -1);
}
/**
@@ -570,7 +579,7 @@ class OrderService
$payment_name = defined('PAYMENT_TYPE') ? PAYMENT_TYPE : (isset($params['paymentname']) ? $params['paymentname'] : '');
if(empty($payment_name))
{
- return DataReturn('支付方式标记异常', -1);
+ return DataReturn(MyLang('payment_method_error_tips'), -1);
}
$payment = PaymentService::PaymentData(['where'=>['payment'=>$payment_name]]);
if(empty($payment))
@@ -585,7 +594,7 @@ class OrderService
{
if(empty($pay_ret['data']['out_trade_no']))
{
- return DataReturn('单号有误', -1);
+ return DataReturn(MyLang('order_no_error_tips'), -1);
}
// 获取订单信息
$where = ['order_no'=>$pay_ret['data']['out_trade_no'], 'is_delete_time'=>0, 'user_is_delete_time'=>0];
@@ -646,22 +655,22 @@ class OrderService
];
if(!Db::name('Order')->where(['id'=>$order_ids])->update($upd_data))
{
- throw new \Exception('订单更新失败');
+ throw new \Exception(MyLang('common_service.order.order_update_fail_tips'));
}
// 循环处理订单
foreach($pay_data['data']['order_list'] as $order)
{
- if(!self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '用户线下支付', 0, '系统'))
+ if(!self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], MyLang('common_service.order.user_under_line_pay_history_desc'), 0, MyLang('system_title')))
{
- throw new \Exception('订单日志添加失败['.$order['id'].']');
+ throw new \Exception(MyLang('common_service.order.order_status_history_insert_fail_tips').'['.$order['id'].']');
}
}
// 更改日志订单状态
if(!Db::name('PayLog')->where(['log_no'=>$pay_log_no])->update(['status'=>1]))
{
- throw new \Exception('日志订单更新失败');
+ throw new \Exception(MyLang('common_service.order.order_status_history_update_fail_tips'));
}
// 完成
@@ -672,7 +681,7 @@ class OrderService
return DataReturn($e->getMessage(), -1);
}
}
- return DataReturn('提交成功、请尽快联系管理员确认支付信息', -8888);
+ return DataReturn(MyLang('common_service.order.order_submit_await_confirm_tips'), -8888);
}
/**
@@ -697,7 +706,7 @@ class OrderService
$pay_name = 'payment\\'.PAYMENT_TYPE;
if(!class_exists($pay_name))
{
- return DataReturn('支付方式不存在['.PAYMENT_TYPE.']', -1);
+ return DataReturn(MyLang('payment_method_no_exist_tips').'['.PAYMENT_TYPE.']', -1);
}
$payment_obj = new $pay_name($payment['config']);
@@ -728,7 +737,7 @@ class OrderService
// 支付订单数据
if(empty($data['out_trade_no']))
{
- return DataReturn('订单号为空[out_trade_no]', -1);
+ return DataReturn(MyLang('order_no_error_tips').'[out_trade_no]', -1);
}
$pay_data = self::OrderPayLogValueList($data['out_trade_no']);
if($pay_data['code'] == 0)
@@ -736,7 +745,7 @@ class OrderService
// 订单支付日志已支付则直接返回
if($pay_data['data']['pay_log_data']['status'] == 1)
{
- return DataReturn('日志订单已支付、无需重复处理', 0);
+ return DataReturn(MyLang('common_service.order.pay_log_already_pay_tips'), 0);
}
} else {
return $pay_data;
@@ -747,7 +756,7 @@ class OrderService
{
if($data['pay_price'] < $pay_data['data']['pay_log_data']['total_price'])
{
- return DataReturn('支付金额小于日志订单金额['.$data['pay_price'].'<'.$pay_data['data']['pay_log_data']['total_price'].']', -1);
+ return DataReturn(MyLang('common_service.order.pay_price_less_than_order_price_tips').'['.$data['pay_price'].'<'.$pay_data['data']['pay_log_data']['total_price'].']', -1);
}
}
@@ -797,14 +806,14 @@ class OrderService
$pay_log_data = Db::name('PayLog')->where(['log_no'=>$pay_log_no])->find();
if(empty($pay_log_data))
{
- return DataReturn('日志订单有误', -1);
+ return DataReturn(MyLang('common_service.order.pay_log_error_tips'), -1);
}
// 获取关联信息
$pay_log_value = Db::name('PayLogValue')->where(['pay_log_id'=>$pay_log_data['id']])->column('business_id');
if(empty($pay_log_value))
{
- return DataReturn('日志订单关联信息有误', -1);
+ return DataReturn(MyLang('common_service.order.pay_log_value_error_tips'), -1);
}
// 获取订单
@@ -835,7 +844,7 @@ class OrderService
// 订单信息
if(empty($params['order']) || !is_array($params['order']))
{
- return DataReturn('订单数据不存在或类型有误', -1);
+ return DataReturn(MyLang('common_service.order.order_data_empty_or_format_error_tips'), -1);
}
// 订单金额大于0必须存在支付方式和订单支付日志
@@ -851,7 +860,7 @@ class OrderService
// 日志订单
if(empty($params['pay_log_data']))
{
- return DataReturn('日志订单有误', -1);
+ return DataReturn(MyLang('common_service.order.pay_log_error_tips'), -1);
}
}
@@ -865,151 +874,144 @@ class OrderService
}
}
- // 开启事务
+ // 启动事务
Db::startTrans();
- // 循环处理
- foreach($params['order'] as $order)
- {
- // 订单非待支付则不处理
- if($order['pay_status'] != 0)
+ // 捕获异常
+ try {
+
+ // 循环处理
+ foreach($params['order'] as $order)
{
- continue;
- }
-
- // 订单支付成功处理前钩子
- $hook_name = 'plugins_service_order_pay_handle_begin';
- $ret = EventReturnHandle(MyEventTrigger($hook_name, [
- 'hook_name' => $hook_name,
- 'is_backend' => true,
- 'params' => &$params,
- 'order_id' => $order['id']
- ]));
- if(isset($ret['code']) && $ret['code'] != 0)
- {
- // 事务回滚
- Db::rollback();
- return $ret;
- }
-
- // 消息通知
- $detail = '订单支付成功,金额'.PriceBeautify($order['total_price']).'元';
- MessageService::MessageAdd($order['user_id'], '订单支付', $detail, self::$business_type_name, $order['id']);
-
- // 订单更新数据
- $upd_data = [
- 'pay_status' => 1,
- 'pay_price' => $order['total_price'],
- 'pay_time' => time(),
- 'upd_time' => time(),
- ];
-
- // 避免先走订单、后走支付的逻辑
- if($order['status'] <= 1)
- {
- $upd_data['status'] = 2;
- }
-
- // 订单金额大于0
- if($order['total_price'] > 0 && !empty($params['payment']))
- {
- // 更新支付方式
- $upd_data['payment_id'] = $params['payment']['id'];
-
- // 是否线下支付
- $upd_data['is_under_line'] = in_array($params['payment']['payment'], MyConfig('shopxo.under_line_list')) ? 1 : 0;
- }
-
- // 更新订单
- if(!Db::name('Order')->where(['id'=>$order['id']])->update($upd_data))
- {
- // 事务回滚
- Db::rollback();
- return DataReturn('订单更新失败['.$order['id'].']', -10);
- }
-
- // 添加状态日志
- if(array_key_exists('status', $upd_data))
- {
- if(!self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '支付', 0, '系统'))
+ // 订单非待支付则不处理
+ if($order['pay_status'] != 0)
{
- // 事务回滚
- Db::rollback();
- return DataReturn('订单日志添加失败['.$order['id'].']', -10);
+ continue;
+ }
+
+ // 订单支付成功处理前钩子
+ $hook_name = 'plugins_service_order_pay_handle_begin';
+ $ret = EventReturnHandle(MyEventTrigger($hook_name, [
+ 'hook_name' => $hook_name,
+ 'is_backend' => true,
+ 'params' => &$params,
+ 'order_id' => $order['id']
+ ]));
+ if(isset($ret['code']) && $ret['code'] != 0)
+ {
+ throw new \Exception($ret['msg']);
+ }
+
+ // 消息通知
+ $detail = MyLang('common_service.order.order_pay_user_message_msg', ['price'=>$order['total_price']]);
+ MessageService::MessageAdd($order['user_id'], MyLang('common_service.order.pay_subject_name'), $detail, self::BusinessTypeName(), $order['id']);
+
+ // 订单更新数据
+ $upd_data = [
+ 'pay_status' => 1,
+ 'pay_price' => $order['total_price'],
+ 'pay_time' => time(),
+ 'upd_time' => time(),
+ ];
+
+ // 避免先走订单、后走支付的逻辑
+ if($order['status'] <= 1)
+ {
+ $upd_data['status'] = 2;
+ }
+
+ // 订单金额大于0
+ if($order['total_price'] > 0 && !empty($params['payment']))
+ {
+ // 更新支付方式
+ $upd_data['payment_id'] = $params['payment']['id'];
+
+ // 是否线下支付
+ $upd_data['is_under_line'] = in_array($params['payment']['payment'], MyConfig('shopxo.under_line_list')) ? 1 : 0;
+ }
+
+ // 更新订单
+ if(!Db::name('Order')->where(['id'=>$order['id']])->update($upd_data))
+ {
+ throw new \Exception(MyLang('common_service.order.order_update_fail_tips').'['.$order['id'].']');
+ }
+
+ // 添加状态日志
+ if(array_key_exists('status', $upd_data))
+ {
+ if(!self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], MyLang('payment_title'), 0, MyLang('system_title')))
+ {
+ throw new \Exception(MyLang('common_service.order.order_status_history_insert_fail_tips').'['.$order['id'].']');
+ }
+ }
+
+ // 库存扣除
+ $ret = BuyService::OrderInventoryDeduct(['order_id'=>$order['id'], 'opt_type'=>'pay']);
+ if($ret['code'] != 0)
+ {
+ throw new \Exception($ret['msg']);
+ }
+
+ // 订单商品销量增加
+ $ret = self::GoodsSalesCountInc(['order_id'=>$order['id'], 'opt_type'=>'pay']);
+ if($ret['code'] != 0)
+ {
+ throw new \Exception($ret['msg']);
+ }
+
+ // 订单支付成功处理完毕钩子
+ $hook_name = 'plugins_service_order_pay_success_handle_end';
+ $ret = EventReturnHandle(MyEventTrigger($hook_name, [
+ 'hook_name' => $hook_name,
+ 'is_backend' => true,
+ 'params' => $params,
+ 'order' => $order,
+ 'order_id' => $order['id']
+ ]));
+ if(isset($ret['code']) && $ret['code'] != 0)
+ {
+ throw new \Exception($ret['msg']);
+ }
+
+ // 虚拟商品自动触发发货操作
+ if($order['order_model'] == 3)
+ {
+ self::OrderDeliveryHandle([
+ 'id' => $order['id'],
+ 'creator' => 0,
+ 'creator_name' => MyLang('system_title'),
+ 'user_id' => $order['user_id'],
+ 'user_type' => 'admin',
+ ]);
}
}
- // 库存扣除
- $ret = BuyService::OrderInventoryDeduct(['order_id'=>$order['id'], 'opt_type'=>'pay']);
- if($ret['code'] != 0)
+ // 更新支付日志
+ if($order_total_price > 0 && !empty($params['pay_log_data']) && !empty($params['payment']))
{
- // 事务回滚
- Db::rollback();
- return $ret;
+ $pay_log_data = [
+ 'log_id' => $params['pay_log_data']['id'],
+ 'trade_no' => isset($params['pay']['trade_no']) ? $params['pay']['trade_no'] : '',
+ 'buyer_user' => isset($params['pay']['buyer_user']) ? $params['pay']['buyer_user'] : '',
+ 'pay_price' => isset($params['pay']['pay_price']) ? $params['pay']['pay_price'] : 0,
+ 'subject' => isset($params['pay']['subject']) ? $params['pay']['subject'] : MyLang('common_service.order.pay_subject_name'),
+ 'payment' => $params['payment']['payment'],
+ 'payment_name' => $params['payment']['name'],
+ ];
+ $ret = PayLogService::PayLogSuccess($pay_log_data);
+ if($ret['code'] != 0)
+ {
+ throw new \Exception($ret['msg']);
+ }
}
- // 订单商品销量增加
- $ret = self::GoodsSalesCountInc(['order_id'=>$order['id'], 'opt_type'=>'pay']);
- if($ret['code'] != 0)
- {
- // 事务回滚
- Db::rollback();
- return $ret;
- }
-
- // 订单支付成功处理完毕钩子
- $hook_name = 'plugins_service_order_pay_success_handle_end';
- $ret = EventReturnHandle(MyEventTrigger($hook_name, [
- 'hook_name' => $hook_name,
- 'is_backend' => true,
- 'params' => $params,
- 'order' => $order,
- 'order_id' => $order['id']
- ]));
- if(isset($ret['code']) && $ret['code'] != 0)
- {
- // 事务回滚
- Db::rollback();
- return $ret;
- }
-
- // 虚拟商品自动触发发货操作
- if($order['order_model'] == 3)
- {
- self::OrderDeliveryHandle([
- 'id' => $order['id'],
- 'creator' => 0,
- 'creator_name' => '系统',
- 'user_id' => $order['user_id'],
- 'user_type' => 'admin',
- ]);
- }
+ // 提交事务
+ Db::commit();
+ return DataReturn(MyLang('pay_success'), 0);
+ } catch(\Exception $e) {
+ Db::rollback();
+ return DataReturn($e->getMessage(), -1);
}
-
- // 更新支付日志
- if($order_total_price > 0 && !empty($params['pay_log_data']) && !empty($params['payment']))
- {
- $pay_log_data = [
- 'log_id' => $params['pay_log_data']['id'],
- 'trade_no' => isset($params['pay']['trade_no']) ? $params['pay']['trade_no'] : '',
- 'buyer_user' => isset($params['pay']['buyer_user']) ? $params['pay']['buyer_user'] : '',
- 'pay_price' => isset($params['pay']['pay_price']) ? $params['pay']['pay_price'] : 0,
- 'subject' => isset($params['pay']['subject']) ? $params['pay']['subject'] : '订单支付',
- 'payment' => $params['payment']['payment'],
- 'payment_name' => $params['payment']['name'],
- ];
- $ret = PayLogService::PayLogSuccess($pay_log_data);
- if($ret['code'] != 0)
- {
- // 事务回滚
- Db::rollback();
- return $ret;
- }
- }
-
- // 提交事务
- Db::commit();
- return DataReturn(MyLang('pay_success'), 0);
}
/**
@@ -1237,6 +1239,9 @@ class OrderService
$order_pay_status = MyLang('common_order_pay_status');
$common_platform_type = MyLang('common_platform_type');
$common_order_type_list = MyLang('common_order_type_list');
+ $order_take_status_name = MyLang('common_service.order.order_take_status_name');
+ $order_under_line_pay_status_name = MyLang('common_service.order.order_under_line_pay_status_name');
+ $order_under_line_name = MyLang('common_service.order.order_under_line_name');
// 仓库信息
if(in_array('warehouse_id', $keys))
@@ -1338,16 +1343,16 @@ class OrderService
}
// 订单模式
- $v['order_model_name'] = isset($common_order_type_list[$v['order_model']]) ? $common_order_type_list[$v['order_model']]['name'] : '未知';
+ $v['order_model_name'] = isset($common_order_type_list[$v['order_model']]) ? $common_order_type_list[$v['order_model']]['name'] : '';
// 客户端
$v['client_type_name'] = isset($common_platform_type[$v['client_type']]) ? $common_platform_type[$v['client_type']]['name'] : '';
// 状态
- $v['status_name'] = ($v['order_model'] == 2 && $v['status'] == 2) ? '待取货' : (array_key_exists($v['status'], $order_status_list) ? $order_status_list[$v['status']]['name'] : '未知');
+ $v['status_name'] = ($v['order_model'] == 2 && $v['status'] == 2) ? $order_take_status_name : (array_key_exists($v['status'], $order_status_list) ? $order_status_list[$v['status']]['name'] : '');
// 支付状态
- $v['pay_status_name'] = (in_array($v['status'], [2,3,4]) && $v['pay_status'] == 0) ? '待确认' : $order_pay_status[$v['pay_status']]['name'];
+ $v['pay_status_name'] = (in_array($v['status'], [2,3,4]) && $v['pay_status'] == 0) ? $order_under_line_pay_status_name : $order_pay_status[$v['pay_status']]['name'];
// 快递公司
$express = (!empty($express_list) && is_array($express_list) && array_key_exists($v['express_id'], $express_list)) ? $express_list[$v['express_id']] : null;
@@ -1366,7 +1371,7 @@ class OrderService
$v['payment_name'] = (!empty($payment_list) && is_array($payment_list) && array_key_exists($v['id'], $payment_list)) ? $payment_list[$v['id']] : null;
// 线下支付 icon 名称
- $v['is_under_line_text'] = ($v['is_under_line'] == 1) ? '线下支付' : null;
+ $v['is_under_line_text'] = ($v['is_under_line'] == 1) ? $order_under_line_name : null;
// 是否可发起售后
$v['is_can_launch_aftersale'] = OrderAftersaleService::OrderIsCanLaunchAftersale($v['collect_time']);
@@ -1418,7 +1423,7 @@ class OrderService
{
$v['items'] = $detail[$v['id']];
$v['items_count'] = count($v['items']);
- $v['describe'] = '共'.$v['buy_number_count'].'件 合计:'.$v['currency_data']['currency_symbol'].$v['total_price'].'元';
+ $v['describe'] = MyLang('common_service.order.order_item_summary_desc', ['buy_number_count'=>$v['buy_number_count'], 'currency_symbol'=>$v['currency_data']['currency_symbol'], 'total_price'=>$v['total_price']]);
}
// 管理员读取
@@ -1458,7 +1463,6 @@ class OrderService
'data' => &$data,
]);
}
-
return DataReturn('success', 0, $data);
}
@@ -1745,7 +1749,7 @@ class OrderService
$text = null;
if(!in_array($order_status, [0,1,5,6]))
{
- $lang = MyLang('orderaftersale_create_title_data');
+ $lang = MyLang('common_service.order.orderaftersale_create_title_data');
if(empty($orderaftersale))
{
$text = $lang['default'];
@@ -1878,12 +1882,13 @@ class OrderService
}
// 用户消息
- MessageService::MessageAdd($order['user_id'], '订单取消', '订单取消成功', self::$business_type_name, $order['id']);
+ $lang = MyLang('common_service.order.order_cancel_message_data');
+ MessageService::MessageAdd($order['user_id'], $lang['title'], $lang['desc'], self::BusinessTypeName(), $order['id']);
// 订单状态日志
$creator = isset($params['creator']) ? intval($params['creator']) : 0;
$creator_name = isset($params['creator_name']) ? htmlentities($params['creator_name']) : '';
- self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '取消', $creator, $creator_name);
+ self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], MyLang('cancel_title'), $creator, $creator_name);
// 提交事务
Db::commit();
@@ -1958,7 +1963,7 @@ class OrderService
$order = Db::name('Order')->where($where)->field('id,status,pay_status,user_id,order_model')->find();
if(empty($order))
{
- throw new \Exception('资源不存在或已被删除');
+ throw new \Exception(MyLang('order_no_exist_or_delete_error_tips'));
}
$operate = self::OrderOperateData($order, $user_type);
if($operate['is_delivery'] != 1)
@@ -1976,12 +1981,12 @@ class OrderService
[
'checked_type' => 'empty',
'key_name' => 'express_id',
- 'error_msg' => '快递id有误',
+ 'error_msg' => MyLang('common_service.order.delivery_express_id_message'),
],
[
'checked_type' => 'empty',
'key_name' => 'express_number',
- 'error_msg' => '快递单号有误',
+ 'error_msg' => MyLang('common_service.order.delivery_express_number_message'),
],
];
$ret = ParamsChecked($params, $p);
@@ -1997,7 +2002,7 @@ class OrderService
[
'checked_type' => 'empty',
'key_name' => 'extraction_code',
- 'error_msg' => '取货码有误',
+ 'error_msg' => MyLang('common_service.order.take_extraction_code_message'),
],
];
$ret = ParamsChecked($params, $p);
@@ -2010,11 +2015,11 @@ class OrderService
$extraction_code = Db::name('OrderExtractionCode')->where(['order_id'=>$order['id']])->value('code');
if(empty($extraction_code))
{
- throw new \Exception('订单取货码不存在、请联系管理员');
+ throw new \Exception(MyLang('common_service.order.take_extraction_code_empty_tips'));
}
if($extraction_code != $params['extraction_code'])
{
- throw new \Exception('取货码不正确');
+ throw new \Exception(MyLang('common_service.order.take_extraction_code_error_tips'));
}
break;
}
@@ -2028,7 +2033,7 @@ class OrderService
];
if(!Db::name('Order')->where($where)->update($upd_data))
{
- throw new \Exception('发货失败');
+ throw new \Exception(MyLang('delivery_fail'));
}
// 库存扣除
@@ -2039,15 +2044,16 @@ class OrderService
}
// 用户消息
- MessageService::MessageAdd($order['user_id'], '订单发货', '订单已发货', self::$business_type_name, $order['id']);
+ $lang = MyLang('common_service.order.order_delivery_message_data');
+ MessageService::MessageAdd($order['user_id'], $lang['title'], $lang['desc'], self::BusinessTypeName(), $order['id']);
// 订单状态日志
$creator = isset($params['creator']) ? intval($params['creator']) : 0;
$creator_name = isset($params['creator_name']) ? htmlentities($params['creator_name']) : '';
- self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '收货', $creator, $creator_name);
+ self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], MyLang('delivery_title'), $creator, $creator_name);
// 完成
- return DataReturn('发货成功', 0);
+ return DataReturn(MyLang('delivery_success'), 0);
} catch(\Exception $e) {
return DataReturn($e->getMessage(), -1);
}
@@ -2149,16 +2155,17 @@ class OrderService
}
// 用户消息
- MessageService::MessageAdd($order['user_id'], '订单收货', '订单收货成功', self::$business_type_name, $order['id']);
+ $lang = MyLang('common_service.order.order_collect_message_data');
+ MessageService::MessageAdd($order['user_id'], $lang['title'], $lang['desc'], self::BusinessTypeName(), $order['id']);
// 订单状态日志
$creator = isset($params['creator']) ? intval($params['creator']) : 0;
$creator_name = isset($params['creator_name']) ? htmlentities($params['creator_name']) : '';
- self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '收货', $creator, $creator_name);
+ self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], MyLang('collect_title'), $creator, $creator_name);
- return DataReturn('收货成功', 0);
+ return DataReturn(MyLang('collect_success'), 0);
}
- return DataReturn('收货失败', -1);
+ return DataReturn(MyLang('collect_fail'), -1);
}
/**
@@ -2208,42 +2215,45 @@ class OrderService
return DataReturn(MyLang('status_not_can_operate_tips').'['.$status_text.']', -1);
}
- // 开启事务
+ // 启动事务
Db::startTrans();
- // 更新订单状态
- $upd_data = [
- 'status' => 1,
- 'confirm_time' => time(),
- 'upd_time' => time(),
- ];
- if(Db::name('Order')->where($where)->update($upd_data))
- {
+ // 捕获异常
+ try {
+ // 更新订单状态
+ $upd_data = [
+ 'status' => 1,
+ 'confirm_time' => time(),
+ 'upd_time' => time(),
+ ];
+ if(!Db::name('Order')->where($where)->update($upd_data))
+ {
+ throw new \Exception(MyLang('confirm_fail'));
+ }
+
// 库存扣除
$ret = BuyService::OrderInventoryDeduct(['order_id'=>$params['id'], 'opt_type'=>'confirm']);
if($ret['code'] != 0)
{
- // 事务回滚
- Db::rollback();
- return DataReturn($ret['msg'], -10);
+ throw new \Exception($ret['msg']);
}
// 用户消息
- MessageService::MessageAdd($order['user_id'], '订单确认', '订单确认成功', self::$business_type_name, $order['id']);
+ $lang = MyLang('common_service.order.order_confirm_message_data');
+ MessageService::MessageAdd($order['user_id'], $lang['title'], $lang['desc'], self::BusinessTypeName(), $order['id']);
// 订单状态日志
$creator = isset($params['creator']) ? intval($params['creator']) : 0;
$creator_name = isset($params['creator_name']) ? htmlentities($params['creator_name']) : '';
- self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '确认', $creator, $creator_name);
+ self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], MyLang('confirm_title'), $creator, $creator_name);
- // 事务提交
+ // 完成
Db::commit();
return DataReturn(MyLang('confirm_success'), 0);
+ } catch(\Exception $e) {
+ Db::rollback();
+ return DataReturn($e->getMessage(), -1);
}
-
- // 事务回滚
- Db::rollback();
- return DataReturn(MyLang('confirm_fail'), -1);
}
/**
@@ -2329,7 +2339,8 @@ class OrderService
}
// 用户消息
- MessageService::MessageAdd($order['user_id'], '订单删除', '订单删除成功', self::$business_type_name, $order['id']);
+ $lang = MyLang('common_service.order.order_delete_message_data');
+ MessageService::MessageAdd($order['user_id'], $lang['title'], $lang['desc'], self::BusinessTypeName(), $order['id']);
// 订单删除成功钩子
$hook_name = 'plugins_service_order_delete_success';
@@ -2519,12 +2530,12 @@ class OrderService
{
if(Db::name('Goods')->where(['id'=>$v['goods_id']])->inc('sales_count', $v['buy_number'])->update() === false)
{
- return DataReturn('订单商品销量增加失败['.$v['title'].']', -10);
+ return DataReturn(MyLang('common_service.order.order_goods_sales_count_inc_fail_tips').'['.$v['title'].']', -10);
}
}
return DataReturn(MyLang('operate_success'), 0);
} else {
- return DataReturn('订单有误,没有找到相关商品', -100);
+ return DataReturn(MyLang('common_service.order.order_detail_goods_empty_tips'), -100);
}
}
return DataReturn(MyLang('handle_noneed'), 0);
@@ -2546,7 +2557,7 @@ class OrderService
[
'checked_type' => 'empty',
'key_name' => 'order_no',
- 'error_msg' => '订单号有误',
+ 'error_msg' => MyLang('order_no_error_tips'),
],
[
'checked_type' => 'empty',
@@ -2565,7 +2576,7 @@ class OrderService
$pay_log = Db::name('PayLog')->where($where)->field('id,status')->find();
if(empty($pay_log))
{
- return DataReturn('支付订单不存在', -400, ['url'=>SystemService::HomeUrl()]);
+ return DataReturn(MyLang('common_service.order.pay_log_error_tips'), -400, ['url'=>SystemService::HomeUrl()]);
}
if($pay_log['status'] == 1)
{
@@ -2578,7 +2589,7 @@ class OrderService
}
return DataReturn(MyLang('pay_success'), 0, ['url'=>$url]);
}
- return DataReturn('支付中', -300);
+ return DataReturn(MyLang('common_service.order.pay_have_in_hand_tips'), -300);
}
/**
@@ -2609,7 +2620,6 @@ class OrderService
$order_ids = implode(',', $ids);
}
}
-
return [
'payment_id' => $payment_id,
'order_ids' => $order_ids,
@@ -2630,7 +2640,7 @@ class OrderService
$result = [];
if(!empty($order))
{
- $lang = MyLang('order_status_setp_data');
+ $lang = MyLang('common_service.order.order_status_setp_data');
$result[] = [
'title' => $lang['add'],
'time' => $order['add_time'],
diff --git a/app/service/OrderSplitService.php b/app/service/OrderSplitService.php
index db063abe0..a0908db94 100644
--- a/app/service/OrderSplitService.php
+++ b/app/service/OrderSplitService.php
@@ -12,6 +12,7 @@ namespace app\service;
use think\facade\Db;
use app\service\WarehouseService;
+use app\service\GoodsService;
/**
* 订单拆分服务层
@@ -36,15 +37,10 @@ class OrderSplitService
{
// 请求参数
$p = [
- [
- 'checked_type' => 'empty',
- 'key_name' => 'goods',
- 'error_msg' => '商品为空',
- ],
[
'checked_type' => 'is_array',
'key_name' => 'goods',
- 'error_msg' => '商品有误',
+ 'error_msg' => MyLang('goods_empty_or_format_error_tips'),
],
];
$ret = ParamsChecked($params, $p);
@@ -254,7 +250,7 @@ class OrderSplitService
foreach($params['goods'] as $v)
{
// 不存在规格则使用默认
- $spec = empty($v['spec']) ? [['type' => '默认规格','value' => 'default']] : $v['spec'];
+ $spec = empty($v['spec']) ? [['type' => GoodsService::GoodsSpecDefaultName(),'value' => 'default']] : $v['spec'];
// 获取商品库存
$where = [
diff --git a/app/service/PackageInstallService.php b/app/service/PackageInstallService.php
index 49762a06e..2f14d2fe5 100644
--- a/app/service/PackageInstallService.php
+++ b/app/service/PackageInstallService.php
@@ -147,7 +147,7 @@ class PackageInstallService
$res = self::DirFileData($params['key']);
if(!file_exists($res['url']))
{
- return DataReturn('软件包不存在、请重新安装', -1);
+ return DataReturn(MyLang('common_service.packageinstall.package_no_exist_tips'), -1);
}
// 根据插件类型调用安装程序
@@ -172,7 +172,7 @@ class PackageInstallService
case 'minitheme' :
if(empty($params['terminal']))
{
- return DataReturn('未指定小程序终端类型', -1);
+ return DataReturn(MyLang('common_service.packageinstall.mini_theme_terminal_not_choice_tips'), -1);
}
$params['application_name'] = $params['terminal'];
$ret = AppMiniService::ThemeUploadHandle($res['url'], $params);
@@ -185,7 +185,7 @@ class PackageInstallService
// 默认
default :
- $ret = DataReturn('插件操作类型未定义['.$params['type'].']', -1);
+ $ret = DataReturn(MyLang('operate_type_error_tips').'['.$params['type'].']', -1);
}
// 移除缓存
@@ -212,7 +212,7 @@ class PackageInstallService
$url = MyCache($key);
if(empty($url))
{
- return DataReturn('下载地址为空', -1);
+ return DataReturn(MyLang('common_service.packageinstall.download_url_empty_tips'), -1);
}
// 获取目录文件
@@ -224,9 +224,9 @@ class PackageInstallService
// 下载保存
if(@file_put_contents($res['url'], RequestGet($url, 300000)) !== false)
{
- return DataReturn('success', 0, $key);
+ return DataReturn(MyLang('download_success'), 0, $key);
}
- return DataReturn('插件下载失败', -1);
+ return DataReturn(MyLang('download_fail'), -1);
}
/**
@@ -312,7 +312,7 @@ class PackageInstallService
[
'checked_type' => 'empty',
'key_name' => 'type',
- 'error_msg' => '插件类型有误',
+ 'error_msg' => MyLang('common_service.packageinstall.plugins_type_error_tips'),
],
[
'checked_type' => 'in',
@@ -330,7 +330,7 @@ class PackageInstallService
// 下载和安装需要校验key
if(in_array($params['opt'], ['download', 'install']) && empty($params['key']))
{
- return DataReturn('操作key有误', -1);
+ return DataReturn(MyLang('common_service.packageinstall.operate_key_error_tips'), -1);
}
return DataReturn('success', 0);
@@ -354,14 +354,14 @@ class PackageInstallService
{
return $ret;
}
- $result = json_decode($ret['data'], true);
- if(empty($result))
+ $data = json_decode($ret['data'], true);
+ if(empty($data))
{
- return DataReturn('商店返回数据有误'.(empty($ret['data']) ? '' : '('.$ret['data'].')'), -1);
+ return DataReturn(MyLang('common_service.packageinstall.store_respond_error_tips').(empty($ret['data']) ? '' : '('.$ret['data'].')'), -1);
}
// 请求成功
- return $result;
+ return $data;
}
}
?>
\ No newline at end of file
diff --git a/app/service/PayLogService.php b/app/service/PayLogService.php
index 9bdc47ca8..833e3736c 100755
--- a/app/service/PayLogService.php
+++ b/app/service/PayLogService.php
@@ -39,30 +39,25 @@ class PayLogService
{
// 请求参数
$p = [
- [
- 'checked_type' => 'empty',
- 'key_name' => 'business_ids',
- 'error_msg' => '业务id为空',
- ],
- [
- 'checked_type' => 'is_array',
- 'key_name' => 'business_ids',
- 'error_msg' => '业务id数据类型有误',
- ],
[
'checked_type' => 'empty',
'key_name' => 'user_id',
- 'error_msg' => '用户id为空',
+ 'error_msg' => MyLang('common_service.paylog.save_user_id_empty_tips'),
],
[
'checked_type' => 'empty',
'key_name' => 'business_type',
- 'error_msg' => '业务类型为空',
+ 'error_msg' => MyLang('common_service.paylog.save_business_type_empty_tips'),
+ ],
+ [
+ 'checked_type' => 'is_array',
+ 'key_name' => 'business_ids',
+ 'error_msg' => MyLang('common_service.paylog.save_business_ids_format_tips'),
],
[
'checked_type' => 'isset',
'key_name' => 'total_price',
- 'error_msg' => '业务金额为空',
+ 'error_msg' => MyLang('common_service.paylog.save_total_price_error_tips'),
],
];
$ret = ParamsChecked($params, $p);
@@ -71,12 +66,6 @@ class PayLogService
return DataReturn($ret, -1);
}
- // 业务id
- if(empty($params['business_ids']))
- {
- return DataReturn('业务id为空', -1);
- }
-
// 日志主数据
$data = [
'log_no' => date('YmdHis').GetNumberCode(6),
@@ -125,7 +114,7 @@ class PayLogService
return DataReturn(MyLang('insert_success'), 0, $data);
}
}
- return DataReturn('支付订单添加失败', -100);
+ return DataReturn(MyLang('common_service.paylog.pay_log_insert_fail_tips'), -100);
}
/**
@@ -147,7 +136,7 @@ class PayLogService
// 参数
if(empty($params['log_id']))
{
- return DataReturn('日志id有误', -100);
+ return DataReturn(MyLang('common_service.paylog.pay_log_id_empty_tips'), -1);
}
// 更新数据
@@ -163,9 +152,9 @@ class PayLogService
];
if(Db::name('PayLog')->where(['id'=>intval($params['log_id']), 'status'=>0])->update($data))
{
- return DataReturn('日志订单更新成功', 0);
+ return DataReturn(MyLang('update_success'), 0);
}
- return DataReturn('日志订单更新失败', -100);
+ return DataReturn(MyLang('common_service.paylog.pay_log_update_fail_tips'), -100);
}
/**
@@ -267,7 +256,6 @@ class PayLogService
{
return DataReturn(MyLang('close_success'), 0);
}
-
return DataReturn(MyLang('close_fail'), -100);
}
}
diff --git a/app/service/PayRequestLogService.php b/app/service/PayRequestLogService.php
index 9205dd2d0..2f62a6b65 100644
--- a/app/service/PayRequestLogService.php
+++ b/app/service/PayRequestLogService.php
@@ -35,7 +35,7 @@ class PayRequestLogService
// 请求参数
if(empty($business_type))
{
- return DataReturn('业务类型为空', -1);
+ return DataReturn(MyLang('common_service.payrequestlog.save_business_type_empty_tips'), -1);
}
// 行为驱动
@@ -69,9 +69,9 @@ class PayRequestLogService
$log_id = Db::name('PayRequestLog')->insertGetId($data);
if($log_id > 0)
{
- return DataReturn('支付请求日志添加成功', 0, $log_id);
+ return DataReturn(MyLang('insert_success'), 0, $log_id);
}
- return DataReturn('支付请求日志添加失败', -100);
+ return DataReturn(MyLang('common_service.payrequestlog.pay_request_log_insert_fail_tips'), -100);
}
/**
@@ -95,9 +95,9 @@ class PayRequestLogService
];
if(Db::name('PayRequestLog')->where(['id'=>$log_id])->update($data))
{
- return DataReturn('支付请求日志更新成功', 0, $log_id);
+ return DataReturn(MyLang('update_success'), 0, $log_id);
}
- return DataReturn('支付请求日志更新失败', -100);
+ return DataReturn(MyLang('common_service.payrequestlog.pay_request_log_update_fail_tips'), -100);
}
/**
diff --git a/app/service/PaymentService.php b/app/service/PaymentService.php
index 9f0a68894..b2febcd5d 100755
--- a/app/service/PaymentService.php
+++ b/app/service/PaymentService.php
@@ -389,12 +389,12 @@ class PaymentService
'checked_type' => 'length',
'key_name' => 'name',
'checked_data' => '2,60',
- 'error_msg' => '名称长度 2~60 个字符',
+ 'error_msg' => MyLang('common_service.payment.form_item_name_message'),
],
[
'checked_type' => 'empty',
'key_name' => 'apply_terminal',
- 'error_msg' => '至少选择一个适用终端',
+ 'error_msg' => MyLang('common_service.payment.form_item_apply_terminal_message'),
],
[
'checked_type' => 'length',
@@ -508,13 +508,13 @@ class PaymentService
// 入口文件目录
if(!is_writable(self::$dir_root_path))
{
- return DataReturn('目录没有操作权限'.'['.self::$dir_root_path.']', -3);
+ return DataReturn(MyLang('common_service.payment.dir_no_power_tips').'['.self::$dir_root_path.']', -3);
}
// 插件权限
if(!is_writable(self::$payment_dir))
{
- return DataReturn('目录没有操作权限'.'['.self::$payment_dir.']', -4);
+ return DataReturn(MyLang('common_service.payment.dir_no_power_tips').'['.self::$payment_dir.']', -4);
}
return DataReturn(MyLang('check_success'), 0);
@@ -640,9 +640,9 @@ class PaymentService
if($success > 0)
{
- return DataReturn('上传成功[成功'.$success.'个支付插件, 失败'.$error.'个无效文件]', 0);
+ return DataReturn(MyLang('common_service.payment.upload_success_tips', ['success'=>$success, 'error'=>$error]), 0);
}
- return DataReturn('上传失败,'.$error.'个无效文件、如功能插件请到[ 应用中心->应用管理 ]模块里面去上传安装', -10);
+ return DataReturn(MyLang('common_service.payment.upload_fail_tips', ['error'=>$error]), -10);
}
/**
@@ -696,7 +696,7 @@ class PaymentService
return DataReturn(MyLang('install_fail'), -100);
}
} else {
- return DataReturn('插件配置有误', -10);
+ return DataReturn(MyLang('plugins_config_error_tips'), -10);
}
}
@@ -731,7 +731,7 @@ class PaymentService
$payment = $params['id'];
if(in_array($payment, self::$cannot_deleted_list))
{
- return DataReturn('该支付方式禁止删除', -10);
+ return DataReturn(MyLang('common_service.payment.payment_not_allow_delete_tips'), -10);
}
// 是否存在
@@ -744,7 +744,7 @@ class PaymentService
// 权限
if(!is_writable($file))
{
- return DataReturn('没操作权限['.$file.']', -3);
+ return DataReturn(MyLang('common_service.payment.file_no_power_tips').'['.$file.']', -3);
}
// 删除
@@ -814,17 +814,17 @@ class PaymentService
[
'checked_type' => 'empty',
'key_name' => 'payment',
- 'error_msg' => '支付唯一标记不能为空',
+ 'error_msg' => MyLang('common_service.payment.create_payment_empty_tips'),
],
[
'checked_type' => 'empty',
'key_name' => 'respond',
- 'error_msg' => '支付同步地址参数不能为空',
+ 'error_msg' => MyLang('common_service.payment.create_respond_empty_tips'),
],
[
'checked_type' => 'empty',
'key_name' => 'notify',
- 'error_msg' => '支付异步地址参数不能为空',
+ 'error_msg' => MyLang('common_service.payment.create_notify_empty_tips'),
],
];
$ret = ParamsChecked($params, $p);
@@ -840,11 +840,6 @@ class PaymentService
return $ret;
}
- if(empty($params['payment']))
- {
- return '支付唯一标记不能为空';
- }
-
// 获取地址所属模块名称、地址标记去除模块名称
$module_notify = 'index';
$module_respond = 'index';
@@ -1052,9 +1047,10 @@ php;
{
return $ret;
}
+ // 标识是否为空
if(empty($params['payment']))
{
- return '支付唯一标记不能为空';
+ return DataReturn(MyLang('common_service.payment.create_payment_empty_tips'), -1);
}
// 处理业务
@@ -1122,7 +1118,7 @@ php;
// 同步返回文件
if(!file_exists(self::$dir_root_path.$file['respond']))
{
- return DataReturn('支付返回入口文件不存在,请联系管理员处理', -10, $result);
+ return DataReturn(MyLang('common_service.payment.pay_respond_file_no_exist_tips'), -10, $result);
}
// 线下支付不生成异步入口文件
@@ -1130,7 +1126,7 @@ php;
{
if(!file_exists(self::$dir_root_path.$file['notify']))
{
- return DataReturn('支付通知入口文件不存在,请联系管理员处理', -11, $result);
+ return DataReturn(MyLang('common_service.payment.pay_notify_file_no_exist_tips'), -11, $result);
}
}
return DataReturn(MyLang('check_success'), 0, $result);
@@ -1178,8 +1174,7 @@ php;
return $res;
}
}
-
- return DataReturn('无插件数据', 0);
+ return DataReturn(MyLang('common_service.payment.no_plugins_data_tips'), 0);
}
/**
diff --git a/app/service/PluginsAdminService.php b/app/service/PluginsAdminService.php
index b2363a8e6..225926920 100755
--- a/app/service/PluginsAdminService.php
+++ b/app/service/PluginsAdminService.php
@@ -197,7 +197,7 @@ class PluginsAdminService
return DataReturn(MyLang('install_fail'), -100);
}
} else {
- return DataReturn('插件配置有误', -10);
+ return DataReturn(MyLang('plugins_config_error_tips'), -10);
}
}
@@ -335,13 +335,13 @@ class PluginsAdminService
{
if(!is_writable($event_file))
{
- return DataReturn('文件没有权限'.'['.$event_file.']', -3);
+ return DataReturn(MyLang('common_service.pluginsadmin.file_no_power_tips').'['.$event_file.']', -3);
}
} else {
// 文件不存在则确认目录是否可写
if(!is_writable(APP_PATH))
{
- return DataReturn('目录操作权限'.'['.$event_file.']', -3);
+ return DataReturn(MyLang('common_service.pluginsadmin.dir_no_power_tips').'['.$event_file.']', -3);
}
}
@@ -411,7 +411,7 @@ class PluginsAdminService
// 应用行为扩展定义文件\nreturn ".var_export(['listen'=>$result], true).";\n?>");
if($ret === false)
{
- return DataReturn('应用钩子部署失败', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_deployment_fail_tips'), -10);
}
return DataReturn(MyLang('handle_success'), 0);
@@ -446,14 +446,14 @@ class PluginsAdminService
$plugins = $params['id'];
if(!file_exists(APP_PATH.'plugins'.DS.$plugins))
{
- return DataReturn('应用不存在', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_no_exist_tips'), -10);
}
// 获取应用标记
$data = Db::name('Plugins')->where(['plugins'=>$plugins])->find();
if(!empty($data['is_enable']))
{
- return DataReturn('请先卸载应用', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.please_uninstall_tips'), -10);
}
// 钩子部署
@@ -538,47 +538,47 @@ class PluginsAdminService
[
'checked_type' => 'empty',
'key_name' => 'plugins',
- 'error_msg' => '应用唯一标记不能为空',
+ 'error_msg' => MyLang('common_service.pluginsadmin.form_item_plugins_message'),
],
[
'checked_type' => 'empty',
'key_name' => 'logo',
- 'error_msg' => '请上传LOGO',
+ 'error_msg' => MyLang('common_service.pluginsadmin.form_item_logo_message'),
],
[
'checked_type' => 'empty',
'key_name' => 'name',
- 'error_msg' => '应用名称不能为空',
+ 'error_msg' => MyLang('common_service.pluginsadmin.form_item_name_message'),
],
[
'checked_type' => 'empty',
'key_name' => 'author',
- 'error_msg' => '作者不能为空',
+ 'error_msg' => MyLang('common_service.pluginsadmin.form_item_author_message'),
],
[
'checked_type' => 'empty',
'key_name' => 'author_url',
- 'error_msg' => '作者主页不能为空',
+ 'error_msg' => MyLang('common_service.pluginsadmin.form_item_author_url_message'),
],
[
'checked_type' => 'empty',
'key_name' => 'version',
- 'error_msg' => '版本号不能为空',
+ 'error_msg' => MyLang('common_service.pluginsadmin.form_item_version_message'),
],
[
'checked_type' => 'empty',
'key_name' => 'desc',
- 'error_msg' => '描述不能为空',
+ 'error_msg' => MyLang('common_service.pluginsadmin.form_item_desc_message'),
],
[
'checked_type' => 'empty',
'key_name' => 'apply_terminal',
- 'error_msg' => '请至少选择一个适用终端',
+ 'error_msg' => MyLang('common_service.pluginsadmin.form_item_apply_terminal_message'),
],
[
'checked_type' => 'empty',
'key_name' => 'apply_version',
- 'error_msg' => '请至少选择一个适用系统版本',
+ 'error_msg' => MyLang('common_service.pluginsadmin.form_item_apply_version_message'),
],
];
$ret = ParamsChecked($params, $p);
@@ -608,7 +608,7 @@ class PluginsAdminService
$app_dir = APP_PATH.'plugins'.DS.$plugins;
if(!is_dir($app_dir) && \base\FileUtil::CreateDir($app_dir) !== true)
{
- return DataReturn('应用主目录创建失败', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_dir_create_fial_tips'), -10);
}
// 生成配置文件
@@ -783,46 +783,46 @@ php;
$app_static_css_dir = ROOT.'public'.DS.'static'.DS.'plugins'.DS.'css'.DS.trim($params['plugins']);
if(!is_dir($app_static_css_dir) && \base\FileUtil::CreateDir($app_static_css_dir) !== true)
{
- return DataReturn('应用静态目录创建失败[css]', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_static_dir_create_fail_tips').'[css]', -10);
} else {
// 后端css目录创建
if(!is_dir($app_static_css_dir.DS.'admin') && \base\FileUtil::CreateDir($app_static_css_dir.DS.'admin') !== true)
{
- return DataReturn('应用静态目录创建失败[css/admin]', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_static_dir_create_fail_tips').'[css/admin]', -10);
}
}
// 后端admin目录创建
if(!is_dir($app_dir.DS.'admin') && \base\FileUtil::CreateDir($app_dir.DS.'admin') !== true)
{
- return DataReturn('应用后端目录创建失败[admin]', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_admin_dir_create_fail_tips').'[admin]', -10);
}
// 创建文件
if(!file_exists($app_dir.DS.'admin'.DS.'Admin.php') && @file_put_contents($app_dir.DS.'admin'.DS.'Admin.php', $admin) === false)
{
- return DataReturn('应用文件创建失败[Admin.php]', -11);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_file_create_fail_tips').'[Admin.php]', -11);
}
if(!file_exists($app_dir.DS.'Hook.php') && @file_put_contents($app_dir.DS.'Hook.php', $hook) === false)
{
- return DataReturn('应用文件创建失败[Hook.php]', -11);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_file_create_fail_tips').'[Hook.php]', -11);
}
// 应用后台视图目录不存在则创建
$app_view_admin_dir = APP_PATH.'plugins'.DS.'view'.DS.trim($params['plugins']).DS.'admin'.DS.'admin';
if(!is_dir($app_view_admin_dir) && \base\FileUtil::CreateDir($app_view_admin_dir) !== true)
{
- return DataReturn('应用视图目录创建失败[admin]', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_view_dir_create_fail_tips').'[admin]', -10);
}
if(!file_exists($app_view_admin_dir.DS.'index.html') && @file_put_contents($app_view_admin_dir.DS.'index.html', $admin_view) === false)
{
- return DataReturn('应用视图文件创建失败[admin-view]', -11);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_view_file_create_fail_tips').'[admin-view]', -11);
}
// css创建
if(!file_exists($app_static_css_dir.DS.'admin'.DS.'admin.css') && @file_put_contents($app_static_css_dir.DS.'admin'.DS.'admin.css', $admin_css) === false)
{
- return DataReturn('应用静态文件创建失败[admin-css]', -11);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_static_file_create_fail_tips').'[admin-css]', -11);
}
// 是否有前端页面
@@ -831,36 +831,36 @@ php;
// 前端index目录创建
if(!is_dir($app_dir.DS.'index') && \base\FileUtil::CreateDir($app_dir.DS.'index') !== true)
{
- return DataReturn('应用前端目录创建失败[index]', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_home_dir_create_fail_tips').'[index]', -10);
}
// 创建文件
if(!file_exists($app_dir.DS.'index'.DS.'Index.php') && @file_put_contents($app_dir.DS.'index'.DS.'Index.php', $index) === false)
{
- return DataReturn('应用文件创建失败[index]', -11);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_file_create_fail_tips').'[index]', -11);
}
// 应用前端视图目录不存在则创建
$app_view_index_dir = APP_PATH.'plugins'.DS.'view'.DS.trim($params['plugins']).DS.'index'.DS.'index';
if(!is_dir($app_view_index_dir) && \base\FileUtil::CreateDir($app_view_index_dir) !== true)
{
- return DataReturn('应用视图目录创建失败[index]', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_view_dir_create_fail_tips').'[index]', -10);
}
if(!file_exists($app_view_index_dir.DS.'index.html') && @file_put_contents($app_view_index_dir.DS.'index.html', $index_view) === false)
{
- return DataReturn('应用视图文件创建失败[index-view]', -11);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_view_file_create_fail_tips').'[index-view]', -11);
}
// 前端css目录创建
if(!is_dir($app_static_css_dir.DS.'index') && \base\FileUtil::CreateDir($app_static_css_dir.DS.'index') !== true)
{
- return DataReturn('应用静态目录创建失败[css/index]', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_static_dir_create_fail_tips').'[css/index]', -10);
}
// css创建
if(!file_exists($app_static_css_dir.DS.'index'.DS.'index.css') && @file_put_contents($app_static_css_dir.DS.'index'.DS.'index.css', $index_css) === false)
{
- return DataReturn('应用静态文件创建失败[index-css]', -11);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_static_file_create_fail_tips').'[index-css]', -11);
}
}
@@ -913,21 +913,21 @@ php;
// 文件存在是否有权限
if(!is_writable($config_file))
{
- return DataReturn('应用配置文件没有操作权限'.'['.$config_file.']', -3);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_config_no_power_tips').'['.$config_file.']', -3);
}
}
// 创建配置文件
if(@file_put_contents($config_file, JsonFormat($data)) === false)
{
- return DataReturn('应用配置文件创建失败', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_config_create_tail_tips'), -10);
}
return DataReturn(MyLang('operate_success'), 0);
}
/**
- * 名称校验
+ * 名称排除校验
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
@@ -936,12 +936,10 @@ php;
*/
public static function PluginsVerification($plugins)
{
- // 排除校验
if(in_array($plugins, self::$plugins_exclude_verification))
{
- return DataReturn('不能使用限制的名称['.$plugins.']', -1);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_name_exclude_tips').'['.$plugins.']', -1);
}
-
return DataReturn(MyLang('check_success'), 0);
}
@@ -972,45 +970,45 @@ php;
$app_dir = APP_PATH.'plugins';
if(!is_writable($app_dir))
{
- return DataReturn('应用目录没有操作权限'.'['.$app_dir.']', -3);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_dir_no_power_tips').'['.$app_dir.']', -3);
}
// 应用视图目录
$app_view_dir = APP_PATH.'plugins'.DS.'view';
if(!is_writable($app_view_dir))
{
- return DataReturn('应用视图目录没有操作权限'.'['.$app_view_dir.']', -3);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_view_dir_no_power_tips').'['.$app_view_dir.']', -3);
}
// 应用css目录
$app_static_css_dir = ROOT.'public'.DS.'static'.DS.'plugins'.DS.'css';
if(!is_writable($app_static_css_dir))
{
- return DataReturn('应用css目录没有操作权限'.'['.$app_static_css_dir.']', -3);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_css_dir_no_power_tips').'['.$app_static_css_dir.']', -3);
}
// 应用js目录
$app_static_js_dir = ROOT.'public'.DS.'static'.DS.'plugins'.DS.'js';
if(!is_writable($app_static_js_dir))
{
- return DataReturn('应用js目录没有操作权限'.'['.$app_static_js_dir.']', -3);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_js_dir_no_power_tips').'['.$app_static_js_dir.']', -3);
}
// 应用images目录
$app_static_images_dir = ROOT.'public'.DS.'static'.DS.'plugins'.DS.'images';
if(!is_writable($app_static_images_dir))
{
- return DataReturn('应用images目录没有操作权限'.'['.$app_static_images_dir.']', -3);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_images_dir_no_power_tips').'['.$app_static_images_dir.']', -3);
}
// 应用upload目录
$app_upload_dir = ROOT.'public'.DS.'static'.DS.'upload';
if(!is_writable($app_upload_dir))
{
- return DataReturn('应用upload目录没有操作权限'.'['.$app_upload_dir.']', -3);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_upload_dir_no_power_tips').'['.$app_upload_dir.']', -3);
}
- return DataReturn('权限正常', 0);
+ return DataReturn('success', 0);
}
/**
@@ -1137,7 +1135,7 @@ php;
// 应用是否存在
if(self::PluginsExist($plugins))
{
- return DataReturn('应用名称已存在['.$plugins.']', -1);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_name_exist_tips').'['.$plugins.']', -1);
}
break;
@@ -1146,7 +1144,7 @@ php;
// 应用是否存在
if($plugins != $plugins_old)
{
- return DataReturn('应用标识与指定不一致['.$plugins.'<>'.$plugins_old.']', -1);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_name_appoint_error_tips').'['.$plugins.'<>'.$plugins_old.']', -1);
}
break;
}
@@ -1160,14 +1158,14 @@ php;
{
if(stripos($file_content, 'namespace payment') !== false)
{
- return DataReturn('支付插件请到[ 网站管理->支付方式 ]模块里面去上传安装', -1);
+ return DataReturn(MyLang('common_service.pluginsadmin.plugins_package_error_tips'), -1);
}
}
fclose($stream);
}
// 不是支付插件则提示插件包错误
- return DataReturn('插件包有误', -30);
+ return DataReturn(MyLang('common_service.pluginsadmin.plugins_package_empty_tips'), -30);
}
// 应用文件处理
@@ -1246,7 +1244,7 @@ php;
// 未匹配成功一个文件则认为插件包无效
if($success <= 0)
{
- return DataReturn('无效的插件包', -1);
+ return DataReturn(MyLang('common_service.pluginsadmin.plugins_package_invalid_tips'), -1);
}
return DataReturn('success', 0, $plugins);
}
@@ -1309,14 +1307,14 @@ php;
$plugins = htmlentities(str_replace(array('.', '/', '\\', ':'), '', strip_tags($params['id'])));
if(empty($plugins))
{
- return DataReturn('插件标识有误', -1);
+ return DataReturn(MyLang('common_service.pluginsadmin.plugins_identification_error_tips'), -1);
}
// 配置信息
$config = self::GetPluginsConfig($plugins);
if(empty($config))
{
- return DataReturn('插件配置有误', -10);
+ return DataReturn(MyLang('plugins_config_error_tips'), -10);
}
// 目录不存在则创建
@@ -1329,7 +1327,7 @@ php;
{
if(\base\FileUtil::CopyDir($old_dir, $new_dir.DS.'_controller_'.DS.$plugins) != true)
{
- return DataReturn(MyLang('project_copy_fail_tips').'[控制器]', -2);
+ return DataReturn(MyLang('project_copy_fail_tips').'['.MyLang('common_service.pluginsadmin.plugins_copy_control_fail_tips').']', -2);
}
}
@@ -1339,7 +1337,7 @@ php;
{
if(\base\FileUtil::CopyDir($old_dir, $new_dir.DS.'_view_'.DS.$plugins) != true)
{
- return DataReturn(MyLang('project_copy_fail_tips').'[视图]', -2);
+ return DataReturn(MyLang('project_copy_fail_tips').'['.MyLang('common_service.pluginsadmin.plugins_copy_view_fail_tips').']', -2);
}
}
@@ -1407,7 +1405,7 @@ php;
$new_config_file = $new_dir.DS.'_controller_'.DS.$plugins.DS.'config.json';
if(!file_exists($new_config_file))
{
- return DataReturn('新配置文件有误', -10);
+ return DataReturn(MyLang('common_service.pluginsadmin.plugins_new_config_error_tips'), -10);
}
if(empty($config['history']))
{
@@ -1421,7 +1419,7 @@ php;
];
if(@file_put_contents($new_config_file, JsonFormat($config)) === false)
{
- return DataReturn('新应用配置文件更新失败', -11);
+ return DataReturn(MyLang('common_service.pluginsadmin.plugins_new_config_update_fail_tips'), -11);
}
// 生成压缩包
@@ -1469,13 +1467,13 @@ php;
// 基础业务参数
if(empty($params['plugins_value']))
{
- return DataReturn('插件标识为空', -1);
+ return DataReturn(MyLang('common_service.pluginsadmin.plugins_identification_empty_tips'), -1);
}
// 应用是否存在
if(!self::PluginsExist($params['plugins_value']))
{
- return DataReturn('应用不存在['.$params['plugins_value'].']、请先安装', -1);
+ return DataReturn(MyLang('common_service.pluginsadmin.app_update_no_exist_tips', ['plugins'=>$params['plugins_value']]), -1);
}
// 插件前置事件
@@ -1533,7 +1531,7 @@ php;
[
'checked_type' => 'empty',
'key_name' => 'data',
- 'error_msg' => '没有可保存的插件数据',
+ 'error_msg' => MyLang('common_service.pluginsadmin.sort_save_data_empty_tips'),
]
];
$ret = ParamsChecked($params, $p);
@@ -1578,7 +1576,7 @@ php;
return DataReturn($e->getMessage(), -1);
}
}
- return DataReturn('插件排序数据有误', -1);
+ return DataReturn(MyLang('common_service.pluginsadmin.sort_save_data_error_tips'), -1);
}
}
?>
\ No newline at end of file
diff --git a/app/service/PluginsService.php b/app/service/PluginsService.php
index d53bbd8ee..dadf22d1d 100755
--- a/app/service/PluginsService.php
+++ b/app/service/PluginsService.php
@@ -175,12 +175,12 @@ class PluginsService
[
'checked_type' => 'empty',
'key_name' => 'plugins',
- 'error_msg' => '应用标记不能为空',
+ 'error_msg' => MyLang('common_service.plugins.plugins_identification_empty_tips'),
],
[
- 'checked_type' => 'isset',
+ 'checked_type' => 'empty',
'key_name' => 'data',
- 'error_msg' => '数据参数不能为空',
+ 'error_msg' => MyLang('common_service.plugins.data_params_empty_tips'),
],
];
$ret = ParamsChecked($params, $p);
@@ -311,15 +311,15 @@ class PluginsService
{
if(IS_AJAX)
{
- return DataReturn('无效插件['.$plugins.']', -10);
+ return DataReturn(MyLang('common_service.plugins.plugins_invalid_tips').'['.$plugins.']', -10);
}
MyRedirect(SystemService::HomeUrl(), true);
}
- return DataReturn('应用未安装['.$plugins.']', -10);
+ return DataReturn(MyLang('common_service.plugins.plugins_not_install_tips').'['.$plugins.']', -10);
}
if($ret != 1)
{
- return DataReturn('应用未启用['.$plugins.']', -11);
+ return DataReturn(MyLang('common_service.plugins.plugins_not_enable_tips').'['.$plugins.']', -11);
}
return DataReturn(MyLang('check_success'), 0);
}
@@ -350,7 +350,7 @@ class PluginsService
$plugins_class = '\app\plugins\\'.$plugins.'\\'.$group.'\\'.$control;
if(!class_exists($plugins_class))
{
- return DataReturn('应用控制器未定义['.$control.']', -1);
+ return DataReturn(MyLang('common_service.plugins.plugins_call_control_undefined_tips').'['.$control.']', -1);
}
// 调用方法
@@ -358,7 +358,7 @@ class PluginsService
$obj = new $plugins_class($params);
if(!method_exists($obj, $action))
{
- return DataReturn('应用方法未定义['.$action.']', -1);
+ return DataReturn(MyLang('common_service.plugins.plugins_call_action_undefined_tips').'['.$action.']', -1);
}
// 调用方法仅传递请求参数
@@ -377,7 +377,7 @@ class PluginsService
$config = PluginsAdminService::GetPluginsConfig($plugins);
if(empty($config) || empty($config['base']))
{
- return DataReturn('应用插件配置信息有误', -1);
+ return DataReturn(MyLang('common_service.plugins.plugins_call_config_error_tips'), -1);
}
$check_params = [
@@ -397,7 +397,7 @@ class PluginsService
}
// 调用对应插件
- return DataReturn('调用成功', 0, $obj->$action($params));
+ return DataReturn('success', 0, $obj->$action($params));
}
/**
@@ -424,7 +424,7 @@ class PluginsService
$plugins = '\app\plugins\\'.$plugins.'\\Event';
if(!class_exists($plugins))
{
- return DataReturn('应用事件未定义['.$plugins.']', 0);
+ return DataReturn(MyLang('common_service.plugins.plugins_event_undefined_tips').'['.$plugins.']', 0);
}
// 调用方法
@@ -432,7 +432,7 @@ class PluginsService
$obj = new $plugins($params);
if(!method_exists($obj, $action))
{
- return DataReturn('应用事件方法未定义['.$action.']', 0);
+ return DataReturn(MyLang('common_service.plugins.plugins_event_action_undefined_tips').'['.$action.']', 0);
}
// 调用方法仅传递请求参数
@@ -445,7 +445,7 @@ class PluginsService
{
return $ret;
}
- return DataReturn('调用成功', 0, $ret);
+ return DataReturn('success', 0, $ret);
}
/**
@@ -525,7 +525,7 @@ class PluginsService
public static function PluginsUpgradeInfo($params = [])
{
// 默认返回数据
- $result = DataReturn('无插件数据', 0);
+ $result = DataReturn(MyLang('common_service.plugins.plugins_no_data_tips'), 0);
// 缓存记录
$time = 3600;
@@ -578,7 +578,6 @@ class PluginsService
} else {
$result = $res;
}
-
return $result;
}
@@ -630,13 +629,13 @@ class PluginsService
{
if(isset($data[$v['plugins']]))
{
- return DataReturn('('.$data[$v['plugins']]['name'].' v'.$v['version_new'].')插件有新版本待更新', -1);
+ return DataReturn(MyLang('common_service.plugins.plugins_new_version_update_tips', ['plugins'=>$data[$v['plugins']]['name'], 'version'=>$v['version_new']]), -1);
}
}
}
}
}
- return DataReturn('无需要更新的插件', 0);
+ return DataReturn(MyLang('common_service.plugins.plugins_no_update_tips'), 0);
}
}
?>
\ No newline at end of file
diff --git a/app/service/WarehouseGoodsService.php b/app/service/WarehouseGoodsService.php
index 42fb844d9..ff1076102 100644
--- a/app/service/WarehouseGoodsService.php
+++ b/app/service/WarehouseGoodsService.php
@@ -521,7 +521,7 @@ class WarehouseGoodsService
// 没有规格则处理默认规格 default
$str = 'default';
$inventory_spec[] = [
- 'name' => '默认规格',
+ 'name' => GoodsService::GoodsSpecDefaultName(),
'spec' => $str,
'md5_key' => md5($str),
'inventory' => 0,