edit-api-entrust

This commit is contained in:
lccsw
2021-11-12 11:09:06 +08:00
parent 09b3b50d47
commit c406ddfce4
16 changed files with 53 additions and 59 deletions
+7 -7
View File
@@ -36,7 +36,7 @@ class Contract extends Wxapp{
$type = $this->input_param('type');
!strlen($type) && $type = 0;
$row = $this->orders_model->get(['id'=>$id,'mobile'=>$this->session['mobile']]);
$row = $this->orders_model->get(['id'=>$id]);
$type_arr = $this->contracts_model->get_types();
if(!$row || !$type_arr[$type]){
throw new Exception('参数错误', API_CODE_INVILD_PARAM);
@@ -148,7 +148,7 @@ class Contract extends Wxapp{
switch($type){
case 0: //整车
$sign_img = array_pop($imgs);
$height = $order['ifentrust'] ? 610 : 520;
$height = $order['ifentrust'] ? 640 : 520;
$jsondata['c_cardid'] && $height += 30;
$res = $sign_entity->merge($sign_img,$img,1070,$height,230);
if(!$res){
@@ -175,7 +175,7 @@ class Contract extends Wxapp{
case 1: //协议
$sign_img = array_pop($imgs);
$srv_count = $order['srv_ids'] ? count(explode(',',$order['srv_ids'])) : 0;
$height = $order['ifentrust'] ? 1400 : 1280;
$height = $order['ifentrust'] ? 1420 : 1280;
$jsondata['c_cardid'] && $height += 30;
$height += $srv_count*52;
$res = $sign_entity->merge($sign_img,$img,1050,$height,300);
@@ -200,7 +200,7 @@ class Contract extends Wxapp{
break;
case 2: //确认信息
$sign_img = array_pop($imgs);
$height = $order['ifentrust'] ? 600 : 480;
$height = $order['ifentrust'] ? 630 : 480;
$jsondata['c_cardid'] && $height += 30;
$res = $sign_entity->merge($sign_img,$img,1050,$height,300);
if(!$res){
@@ -226,7 +226,7 @@ class Contract extends Wxapp{
break;
case 3: //车辆交接
$sign_img = array_pop($imgs);
$height = $order['ifentrust'] ? 1470 : 1350;
$height = $order['ifentrust'] ? 1510 : 1350;
$res = $sign_entity->merge($sign_img,$img,1050,$height,350);
if(!$res){
throw new Exception('签名失败', API_CODE_INVILD_PARAM);
@@ -249,7 +249,7 @@ class Contract extends Wxapp{
break;
case 4://车辆买卖合同补充协议
$sign_img = array_pop($imgs);
$height = $order['ifentrust'] ? 1470 : 1350;
$height = $order['ifentrust'] ? 1480 : 1350;
$res = $sign_entity->merge($sign_img,$img,1050,$height,350);
if(!$res){
throw new Exception('签名失败', API_CODE_INVILD_PARAM);
@@ -277,7 +277,7 @@ class Contract extends Wxapp{
break;
case 5://委托服务补充协议
$sign_img = array_pop($imgs);
$height = $order['ifentrust'] ? 1270 : 1150;
$height = $order['ifentrust'] ? 1280 : 1150;
$res = $sign_entity->merge($sign_img,$img,1050,$height,340);
if(!$res){
throw new Exception('签名失败', API_CODE_INVILD_PARAM);
+6 -2
View File
@@ -392,12 +392,16 @@ class User extends Wxapp{
!$page && $page = 1;
!$size && $size = 10;
$count = $this->orders_model->get_finsh($this->session['mobile'],'','',1);
$where = [
"mobile" => $this->session['mobile'],
"status" => 6,
];
$count = $this->orders_model->count($where);
$lists = [];
if($count){
$this->load->model("items/items_model");
$this->load->model('receiver/order/receiver_order_agents_model','agents_model');
$rows = $this->orders_model->get_finsh($this->session['mobile'],$page,$size);
$rows = $this->orders_model->select($where,'id desc',$page,$size);
//品牌车型
$brand_arr = array_unique(array_column($rows,'brand_id'));
$brands = $this->auto_brand_model->get_map_by_ids($brand_arr,'id,name');
+3 -1
View File
@@ -70,7 +70,7 @@ class Cusorder extends Wxapp{
$ifentrust = $this->input_param('ifentrust');
$entrust_name = $this->input_param('entrust_name');
$entrust_idcard = $this->input_param('entrust_idcard');
$entrust_idcard = $this->input_param('entrust_idcard');
$entrust_mobile = $this->input_param('entrust_mobile');
$name = $this->input_param('name');
$mobile = $this->input_param('mobile');
$address = $this->input_param('address');
@@ -177,6 +177,7 @@ class Cusorder extends Wxapp{
$data['ifentrust'] = 1;
$info_json['entrust_name'] = $entrust_name;
$info_json['entrust_idcard'] = $entrust_idcard;
$info_json['entrust_mobile'] = $entrust_mobile;
}
$cardid && $info_json['c_cardid'] = $cardid;
$address && $info_json['c_address'] = $address;
@@ -416,6 +417,7 @@ class Cusorder extends Wxapp{
$car_data['是否委托'] = $row['ifentrust'] ? '是' : '否';
if($row['ifentrust']){
$car_data['委托人姓名'] = $info_json['entrust_name'] ? $info_json['entrust_name'] : '';
$car_data['委托人手机号'] = $info_json['entrust_mobile'] ? $info_json['entrust_mobile'] : '';
$car_data['委托人身份证'] = $info_json['entrust_idcard'] ? $info_json['entrust_idcard'] : '';
}
}
@@ -41,6 +41,7 @@
<div><b>联系电话:</b><?=$mobile?></div>
<?if($ifentrust){?>
<div><b>受托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div><b>乙方为节省时间和精力,就甲乙双方《车辆买卖合同》标的的车辆,自愿委托甲方办理下列委托事项,并达成如下协议:</b></div>
@@ -18,6 +18,7 @@
<div><b>联系电话:</b><?=$mobile?></div>
<?if($ifentrust){?>
<div><b>受托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div><b>本协议中的所有术语,除非另有说明,否则其定义与双方于<?=date('Y-m-d',strtotime($old_contract['sign_time']))?>签订协议编号为<?=$old_contract['cid']?>的《委托服务协议》(以下简称“原协议”)中的定义相同。</b></div>
+1
View File
@@ -18,6 +18,7 @@
<div><b>联系电话:</b><?=$mobile?></div>
<?if($ifentrust){?>
<div><b>受托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div><b>甲、乙双方依据《中华人民共和国合同法》及其他有关法律、法规的规定,在平等、自愿、协商一致的基础上,就买卖汽车事宜,订立本合同。</b></div>
@@ -17,6 +17,7 @@
<div><b>联系电话:</b><?=$mobile?></div>
<?if($ifentrust){?>
<div><b>受托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div>乙方于<?=date('Y年m月d日',$c_time)?>在甲方购买 <?=$brand_name?> 车辆 1 台,并确认车架号为:<?=$vin?>。乙方已对上述车辆的厂牌型号、配置等进行认真检查并验收合格无异议。</div>
@@ -17,6 +17,7 @@
<div><b>联系电话:</b><?=$mobile?></div>
<?if($ifentrust){?>
<div><b>受托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div><b>一、车辆信息</b></div>
@@ -15,6 +15,7 @@
<div><b>联系电话:</b><?=$mobile?></div>
<?if($ifentrust){?>
<div><b>委托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div><b>本协议中的所有术语,除非另有说明,否则其定义与双方于<?=date('Y-m-d',strtotime($old_contract['sign_time']))?>签订合同编号为<?=$old_contract['cid']?>的《车辆买卖合同》(以下简称“原合同”)中的定义相同。</b></div>
@@ -22,6 +22,7 @@
<div><b>联系电话:</b><?=$mobile?></div>
<?if($ifentrust){?>
<div><b>受托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div><b>乙方为节省时间和精力,就甲乙双方《车辆买卖合同》标的的车辆,自愿委托甲方办理下列委托事项,并达成如下协议:</b></div>
@@ -21,6 +21,7 @@
<?}?>
<?if($ifentrust){?>
<div><b>受托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div><b>本协议中的所有术语,除非另有说明,否则其定义与双方于<?=date('Y-m-d',strtotime($old_contract['sign_time']))?>签订协议编号为<?=$old_contract['cid']?>的《委托服务协议》(以下简称“原协议”)中的定义相同。</b></div>
+1
View File
@@ -22,6 +22,7 @@
<div><b>联系电话:</b><?=$mobile?></div>
<?if($ifentrust){?>
<div><b>受托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div><b>甲、乙双方依据《中华人民共和国合同法》及其他有关法律、法规的规定,在平等、自愿、协商一致的基础上,就买卖汽车事宜,订立本合同。</b></div>
@@ -21,6 +21,7 @@
<div><b>联系电话:</b><?=$mobile?></div>
<?if($ifentrust){?>
<div><b>受托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div>乙方于<?=date('Y年m月d日',$c_time)?>在甲方购买 <?=$brand_name?> 车辆 1 台,并确认车架号为:<?=$vin?>。乙方已对上述车辆的厂牌型号、配置等进行认真检查并验收合格无异议。</div>
@@ -21,6 +21,7 @@
<div><b>联系电话:</b><?=$mobile?></div>
<?if($ifentrust){?>
<div><b>受托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div><b>一、车辆信息</b></div>
@@ -19,6 +19,7 @@
<div><b>联系电话:</b><?=$mobile?></div>
<?if($ifentrust){?>
<div><b>受托代理人:</b><?=$info_json['entrust_name']?></div>
<div><b>受托人电话:</b><?=$info_json['entrust_mobile']?></div>
<div><b>受托人身份证:</b><?=$info_json['entrust_idcard']?></div>
<?}?>
<div><b>本协议中的所有术语,除非另有说明,否则其定义与双方于<?=date('Y-m-d',strtotime($old_contract['sign_time']))?>签订合同编号为<?=$old_contract['cid']?>的《车辆买卖合同》(以下简称“原合同”)中的定义相同。</b></div>
@@ -52,61 +52,37 @@ class Receiver_orders_model extends HD_Model
public function get_step($mobile)
{
$t1 = 'lc_receiver_orders';
//$t2 = 'lc_receiver_order_contracts';
$this->db->select("$t1.*");
$this->db->from($t1);
//$this->db->join($t2, "$t2.o_id = $t1.id and $t2.type=3",'left');
//$t1 = 'lc_receiver_orders';
//$this->db->select("$t1.*");
//$this->db->from($t1);
//$where = [
// "$t1.mobile" => $mobile,
// "($t2.status<1 or $t2.status is null)" => null
// "$t1.status<" => 6,
// "$t1.status>=" => 0,
// "$t1.brand_id>" => 0
//];
//$this->db->where($where);
//$this->db->order_by("$t1.id desc");
//$this->db->limit(1);
//$row = $this->db->get()->row_array();
$where = [
"$t1.mobile" => $mobile,
"$t1.status<" => 6,
"$t1.status>=" => 0,
"$t1.brand_id>" => 0
'mobile' => $mobile,
'status>=' => 0,
'status<' => 6,
'brand_id>' => 0
];
$this->db->where($where);
$this->db->order_by("$t1.id desc");
$this->db->limit(1);
$row = $this->db->get()->row_array();
return $row;
}
//获取交车列表
public function get_finsh($mobile, $page, $size, $count)
{
$t1 = 'lc_receiver_orders';
//$t2 = 'lc_receiver_order_contracts';
$this->db->select("$t1.*");
$this->db->from($t1);
//$this->db->join($t2, "$t2.o_id = $t1.id and $t2.type=3",'left');
//$where = [
// "$t1.mobile" => $mobile,
// "$t2.status" => 1,
//];
$where = [
"$t1.mobile" => $mobile,
"$t1.status" => 6,
];
$this->db->where($where);
if ($count) {
return $this->db->count_all_results();
$row = $this->select($where,'id desc',1,1);
if(!$row){ //本人不存在订单 代办订单
$where = [
'ifentrust' => 1,
"json_extract(info_json,'$.entrust_mobile')='{$mobile}'" => null,
'status>=' => 0,
'status<' => 6,
'brand_id>' => 0
];
$row = $this->select($where,'id desc',1,1);
}
$this->db->order_by("$t1.id desc");
if ($page) {
$offset = ($page - 1) * $size;
$limit = $size;
} else {
$offset = null;
$limit = null;
}
$this->db->limit($limit, $offset);
return $this->db->get()->result_array();
return $row[0];
}
public function get_status()