diff --git a/service/Application/Admin/Controller/PaymentController.class.php b/service/Application/Admin/Controller/PaymentController.class.php index 4ea3c6f4c..6abd8c04e 100755 --- a/service/Application/Admin/Controller/PaymentController.class.php +++ b/service/Application/Admin/Controller/PaymentController.class.php @@ -15,6 +15,7 @@ class PaymentController extends CommonController { private $payment_dir; private $payment_business_type_all; + private $cannot_deleted_list; /** * [_initialize 前置操作-继承公共前置方法] @@ -39,6 +40,9 @@ class PaymentController extends CommonController // 支付业务类型 $this->payment_business_type_all = C('payment_business_type_all'); + + // 不删除的支付方式 + $this->cannot_deleted_list = ['DeliveryPayment', 'CashPayment']; } /** @@ -50,8 +54,8 @@ class PaymentController extends CommonController */ public function Index() { - // 数据列表 $this->assign('list', $this->GetPaymentList()); + $this->assign('cannot_deleted_list', $this->cannot_deleted_list); $this->display('Index'); } @@ -93,8 +97,9 @@ class PaymentController extends CommonController $temp['name'] = $db_config[0]['name']; $temp['logo'] = $db_config[0]['logo']; $temp['apply_terminal'] = $db_config[0]['apply_terminal']; - $temp['is_enable'] = $db_config[0]['is_enable']; $temp['config'] = $db_config[0]['config']; + $temp['is_enable'] = $db_config[0]['is_enable']; + $temp['is_open_user'] = $db_config[0]['is_open_user']; } $data[] = $temp; } @@ -128,6 +133,7 @@ class PaymentController extends CommonController 'logo' => '', 'is_enable' => 0, + 'is_open_user' => 0, 'is_install' => 0, 'apply_terminal'=> array_column(L('common_apply_terminal_list'), 'value'), 'config' => '', @@ -206,6 +212,7 @@ class PaymentController extends CommonController // 公共额外数据处理 $_POST['is_enable'] = intval(I('is_enable', 0)); + $_POST['is_open_user'] = intval(I('is_open_user', 0)); // 编辑 if($m->create($_POST, 2)) @@ -273,9 +280,10 @@ class PaymentController extends CommonController { $this->ajaxReturn(L('common_param_error'), -1); } + $field = I('field', 'is_enable'); // 数据更新 - if(M('Payment')->where(array('payment'=>I('id')))->save(array('is_enable'=>I('state')))) + if(M('Payment')->where(array('payment'=>I('id')))->save(array($field=>I('state')))) { $this->ajaxReturn(L('common_operation_edit_success')); } else { @@ -419,8 +427,14 @@ class PaymentController extends CommonController $this->ajaxReturn(L('common_param_error'), -1); } - // 是否存在 + // 是否禁止删除 $payment = I('id'); + if(in_array($payment, $this->cannot_deleted_list)) + { + $this->ajaxReturn(L('payment_cannot_deleted_error'), -10); + } + + // 是否存在 $file = $this->payment_dir.$payment.'.class.php'; if(!file_exists($file)) { diff --git a/service/Application/Admin/Lang/zh-cn/order.php b/service/Application/Admin/Lang/zh-cn/order.php index 229b52c75..85fdb2f1a 100755 --- a/service/Application/Admin/Lang/zh-cn/order.php +++ b/service/Application/Admin/Lang/zh-cn/order.php @@ -12,11 +12,11 @@ return array( 'order_time_start_text' => '起始时间', 'order_time_end_text' => '结束时间', - 'order_goods_text' => '商品信息', + 'order_base_text' => '基础信息', 'order_receive_text' => '收件信息', 'order_express_text' => '快递信息', 'order_user_note_text' => '用户备注', - 'order_price_text' => '订单金额(元)', + 'order_price_th_text' => '订单金额(元)', 'order_confirm_time_text' => '确认时间', 'order_pay_time_text' => '支付时间', @@ -29,5 +29,12 @@ return array( 'order_business_express_title' => '选择快递', 'order_express_number_text' => '快递单号', 'order_express_number_format' => '请填写快递单号', + + 'order_order_no_text' => '订单号', + + 'order_price_text' => '金额', + 'order_preferential_price_text' => '优惠', + 'order_total_price_text' => '总价', + 'order_pay_price_text' => '支付', ); ?> \ No newline at end of file diff --git a/service/Application/Admin/Lang/zh-cn/payment.php b/service/Application/Admin/Lang/zh-cn/payment.php index 503c98241..b7db6a6ac 100755 --- a/service/Application/Admin/Lang/zh-cn/payment.php +++ b/service/Application/Admin/Lang/zh-cn/payment.php @@ -33,5 +33,8 @@ return array( 'payment_upload_format' => '文件格式有误,必须php文件', 'payment_upload_error' => '插件编写有误,请参考文档编写', 'payment_plugins_element_tips' => '该区域为插件配置填写项,请按照插件文档填写相应的值。', + + 'payment_cannot_deleted_error' => '该支付方式禁止删除', + 'payment_is_open_user_text' => '对用户放开', ); ?> \ No newline at end of file diff --git a/service/Application/Admin/View/Default/Order/Index.html b/service/Application/Admin/View/Default/Order/Index.html index e93dd2e8e..bda6f0a58 100755 --- a/service/Application/Admin/View/Default/Order/Index.html +++ b/service/Application/Admin/View/Default/Order/Index.html @@ -48,12 +48,12 @@
{{:L('common_order_status_name')}} | -{{:L('common_pay_status_name')}} | -{{:L('order_price_text')}} | + +{{:L('order_price_th_text')}} | {{:L('common_more_name')}} | {{:L('common_operation_name')}} |
---|---|---|---|---|---|
+ |
- 订单金额:{{$v.price}} - 优惠金额:{{$v.preferential_price}} - 订单总价:{{$v.total_price}} - 支付金额:{{$v.pay_price}} + {{:L('order_price_text')}}:{{$v.price}} + {{:L('order_preferential_price_text')}}:{{$v.preferential_price}} + {{:L('order_total_price_text')}}:{{$v.total_price}} + {{:L('order_pay_price_text')}}:{{$v.pay_price}} |
|
@@ -125,7 +126,10 @@
|
+
+
+
+ checked="true" />
+
+
checked="true" />
diff --git a/service/Application/Home/Controller/BuyController.class.php b/service/Application/Home/Controller/BuyController.class.php
index d0f951a35..4040c7363 100755
--- a/service/Application/Home/Controller/BuyController.class.php
+++ b/service/Application/Home/Controller/BuyController.class.php
@@ -55,10 +55,10 @@ class BuyController extends CommonController
$this->assign('user_address_list', UserService::UserAddressList(['user'=>$this->user])['data']);
// 快递
- $this->assign('express_list', ResourcesService::ExpressList(['is_enable'=>1]));
+ $this->assign('express_list', ResourcesService::ExpressList(['is_enable'=>1, 'is_open_user'=>1]));
// 支付方式
- $this->assign('payment_list', ResourcesService::BuyPaymentList(['is_enable'=>1]));
+ $this->assign('payment_list', ResourcesService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1]));
// 商品/基础信息
$base = [
diff --git a/service/Application/Home/Controller/OrderController.class.php b/service/Application/Home/Controller/OrderController.class.php
index c6c4c8252..cd886f363 100755
--- a/service/Application/Home/Controller/OrderController.class.php
+++ b/service/Application/Home/Controller/OrderController.class.php
@@ -50,7 +50,6 @@ class OrderController extends CommonController
// 条件
$where = OrderService::HomeOrderListWhere($params);
-
// 获取总数
$total = OrderService::OrderTotal($where);
@@ -74,7 +73,7 @@ class OrderController extends CommonController
$this->assign('data_list', $data['data']);
// 发起支付 - 支付方式
- $this->assign('buy_payment_list', ResourcesService::BuyPaymentList());
+ $this->assign('buy_payment_list', ResourcesService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1]));
// 支付方式
$this->assign('payment_list', ResourcesService::PaymentList());
diff --git a/service/Application/Library/Payment/CashPayment.class.php b/service/Application/Library/Payment/CashPayment.class.php
new file mode 100644
index 000000000..dc513b7b9
--- /dev/null
+++ b/service/Application/Library/Payment/CashPayment.class.php
@@ -0,0 +1,92 @@
+config = $params;
+ }
+
+ /**
+ * 配置信息
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2018-09-19
+ * @desc description
+ */
+ public function Config()
+ {
+ // 基础信息
+ $base = [
+ 'name' => '现金支付', // 插件名称
+ 'version' => '0.0.1', // 插件版本
+ 'apply_version' => '不限', // 适用系统版本描述
+ 'desc' => '现金方式支付货款', // 插件描述(支持html)
+ 'author' => 'Devil', // 开发者
+ 'author_url' => 'http://gong.gg/', // 开发者主页
+ ];
+
+ // 配置信息
+ $element = [
+ ];
+
+ return [
+ 'base' => $base,
+ 'element' => $element,
+ ];
+ }
+
+ /**
+ * 支付入口
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2018-09-19
+ * @desc description
+ * @param [array] $params [输入参数]
+ */
+ public function Pay($params = [])
+ {
+
+ $url = __MY_URL__.'payment_order_'.strtolower(substr(__CLASS__, strripos(__CLASS__, '\\')+1)).'_respond.php';
+ return DataReturn('处理成功', 0, $url);
+ }
+
+ /**
+ * 支付回调处理
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2018-09-19
+ * @desc description
+ * @param [array] $params [输入参数]
+ */
+ public function Respond($params = [])
+ {
+ return DataReturn('处理成功', 0);
+ }
+}
+?>
\ No newline at end of file
diff --git a/service/Application/Library/Payment/DeliveryPayment.class.php b/service/Application/Library/Payment/DeliveryPayment.class.php
new file mode 100644
index 000000000..d695ff74d
--- /dev/null
+++ b/service/Application/Library/Payment/DeliveryPayment.class.php
@@ -0,0 +1,91 @@
+config = $params;
+ }
+
+ /**
+ * 配置信息
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2018-09-19
+ * @desc description
+ */
+ public function Config()
+ {
+ // 基础信息
+ $base = [
+ 'name' => '货到付款', // 插件名称
+ 'version' => '0.0.1', // 插件版本
+ 'apply_version' => '不限', // 适用系统版本描述
+ 'desc' => '送货上门后收取货款', // 插件描述(支持html)
+ 'author' => 'Devil', // 开发者
+ 'author_url' => 'http://gong.gg/', // 开发者主页
+ ];
+
+ // 配置信息
+ $element = [
+ ];
+
+ return [
+ 'base' => $base,
+ 'element' => $element,
+ ];
+ }
+
+ /**
+ * 支付入口
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2018-09-19
+ * @desc description
+ * @param [array] $params [输入参数]
+ */
+ public function Pay($params = [])
+ {
+ $url = __MY_URL__.'payment_order_'.strtolower(substr(__CLASS__, strripos(__CLASS__, '\\')+1)).'_respond.php';
+ return DataReturn('处理成功', 0, $url);
+ }
+
+ /**
+ * 支付回调处理
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2018-09-19
+ * @desc description
+ * @param [array] $params [输入参数]
+ */
+ public function Respond($params = [])
+ {
+ return DataReturn('处理成功', 0);
+ }
+}
+?>
\ No newline at end of file
diff --git a/service/Application/Service/ResourcesService.class.php b/service/Application/Service/ResourcesService.class.php
index ee92a7735..cfb264873 100755
--- a/service/Application/Service/ResourcesService.class.php
+++ b/service/Application/Service/ResourcesService.class.php
@@ -66,9 +66,16 @@ class ResourcesService
public static function PaymentList($params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
- $where['is_enable'] = isset($params['is_enable']) ? intval($params['is_enable']) : 1;
+ if(isset($params['is_enable']))
+ {
+ $where['is_enable'] = intval($params['is_enable']);
+ }
+ if(isset($params['is_open_user']))
+ {
+ $where['is_open_user'] = intval($params['is_open_user']);
+ }
- $data = M('Payment')->where($where)->field('id,logo,name,sort,payment,config,apply_terminal,apply_terminal,element,is_enable')->order('sort asc')->select();
+ $data = M('Payment')->where($where)->field('id,logo,name,sort,payment,config,apply_terminal,apply_terminal,element,is_enable,is_open_user')->order('sort asc')->select();
if(!empty($data) && is_array($data))
{
$images_host = C('IMAGE_HOST');
diff --git a/service/Public/Admin/Default/Css/Order.css b/service/Public/Admin/Default/Css/Order.css
index d6e274085..a3b07e2ed 100755
--- a/service/Public/Admin/Default/Css/Order.css
+++ b/service/Public/Admin/Default/Css/Order.css
@@ -23,7 +23,8 @@
.am-table .goods-item { padding: 5px 0; }
.am-table .goods-item, .am-table .goods-item .base { overflow: hidden; }
.am-table .goods-item .other .fl { width: 60%; }
-.am-table .goods-item:not(:last-child) { border-bottom: 1px solid #eee; }
+.am-table .goods-item:not(:last-child), .am-table .order-no { border-bottom: 1px solid #eee; }
+.am-table .order-no { font-weight: 700; color: #333;}
/**
diff --git a/service/payment_order_cashpayment_notify.php b/service/payment_order_cashpayment_notify.php
new file mode 100644
index 000000000..a24a33d6b
--- /dev/null
+++ b/service/payment_order_cashpayment_notify.php
@@ -0,0 +1,21 @@
+
\ No newline at end of file
diff --git a/service/payment_order_cashpayment_respond.php b/service/payment_order_cashpayment_respond.php
new file mode 100644
index 000000000..0cdf88100
--- /dev/null
+++ b/service/payment_order_cashpayment_respond.php
@@ -0,0 +1,21 @@
+
\ No newline at end of file
diff --git a/service/payment_order_deliverypayment_notify.php b/service/payment_order_deliverypayment_notify.php
new file mode 100644
index 000000000..c196d909b
--- /dev/null
+++ b/service/payment_order_deliverypayment_notify.php
@@ -0,0 +1,21 @@
+
\ No newline at end of file
diff --git a/service/payment_order_deliverypayment_respond.php b/service/payment_order_deliverypayment_respond.php
new file mode 100644
index 000000000..b31df7463
--- /dev/null
+++ b/service/payment_order_deliverypayment_respond.php
@@ -0,0 +1,21 @@
+
\ No newline at end of file
|