|
@@ -23,7 +23,7 @@ class Agreement
|
|
|
if ($source == 2) {
|
|
|
|
|
|
$aid = Dever::load('passport/user')->check(false);
|
|
|
- $aid = 18;
|
|
|
+ $aid = 1;
|
|
|
if (!$aid || $aid <= 0) {
|
|
|
Dever::alert('请先登录');
|
|
|
}
|
|
@@ -57,6 +57,13 @@ class Agreement
|
|
|
Dever::alert('您没有权限查看');
|
|
|
}
|
|
|
|
|
|
+ if (isset($p['ids'])) {
|
|
|
+ $info['jiaofu_id'] = $p['ids'];
|
|
|
+ }
|
|
|
+ if (isset($p['total'])) {
|
|
|
+ $info['jiaofu_total'] = $p['total'];
|
|
|
+ }
|
|
|
+
|
|
|
$method = 'pdf_' . $agreement['type'];
|
|
|
return $this->$method($agreement, $info);
|
|
|
}
|
|
@@ -73,8 +80,14 @@ class Agreement
|
|
|
}
|
|
|
|
|
|
|
|
|
- public function name($agreement, $info, $status = -1, $source = 1)
|
|
|
+ public function name($agreement, $info, $status = -1, $source = 1, $ids = false, $total = false)
|
|
|
{
|
|
|
+ if (!$agreement) {
|
|
|
+ $agreement = Dever::db('setting/agreement')->find(array('type' => 6));
|
|
|
+ if (!$agreement) {
|
|
|
+ Dever::alert('协议模板不存在');
|
|
|
+ }
|
|
|
+ }
|
|
|
if (is_numeric($agreement)) {
|
|
|
$agreement = Dever::db('setting/agreement')->find($agreement);
|
|
|
}
|
|
@@ -97,6 +110,12 @@ class Agreement
|
|
|
$param['status'] = $status;
|
|
|
$param['id'] = $info['id'];
|
|
|
$param['agreement_id'] = $agreement['id'];
|
|
|
+ if ($ids) {
|
|
|
+ $param['ids'] = $ids;
|
|
|
+ }
|
|
|
+ if ($total) {
|
|
|
+ $param['total'] = $total;
|
|
|
+ }
|
|
|
$param = Dever::encode(Dever::json_encode($param));
|
|
|
$link = Dever::url('option/lib/agreement.show?p=' . $param);
|
|
|
if ($source == 1) {
|
|
@@ -392,9 +411,15 @@ class Agreement
|
|
|
{
|
|
|
$base = Dever::db('setting/base')->find();
|
|
|
|
|
|
- $jiaofu_id = explode(',', $info['jiaofu_id']);
|
|
|
- $jiaofu = Dever::db('option/bill_jiaofu')->find($jiaofu_id[0]);
|
|
|
- $info['jiaofu_date'] = date("Y年m月d日", $jiaofu['cdate']);
|
|
|
+ if (isset($info['jiaofu_id'])) {
|
|
|
+ $jiaofu_id = explode(',', $info['jiaofu_id']);
|
|
|
+ $jiaofu = Dever::db('option/bill_jiaofu')->find($jiaofu_id[0]);
|
|
|
+ $info['jiaofu_date'] = date("Y年m月d日", $jiaofu['cdate']);
|
|
|
+ } else {
|
|
|
+ $info['jiaofu_total'] = '0.00';
|
|
|
+ $info['jiaofu_date'] = date("Y年m月d日");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if (isset($info['qdate']) && $info['qdate']) {
|
|
|
$qdate = date('Y年m月d日', $info['qdate']);
|