From 0e30de2572c5fbd95e2bd407c064d5210701eef1 Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Thu, 22 Jul 2021 09:56:48 +0800 Subject: [PATCH] edit-liche-wxapp --- admin/views/receiver/orders/get.php | 4 +- api/controllers/Test.php | 76 ------------------- api/controllers/wxapp/liche/Aptinfo.php | 34 ++++----- api/controllers/wxapp/liche/Car.php | 15 ++-- api/controllers/wxapp/liche/Contract.php | 2 +- api/controllers/wxapp/liche/User.php | 17 ++++- api/controllers/wxapp/licheb/Cusorder.php | 4 +- api/controllers/wxapp/licheb/Customers.php | 53 +++++++++---- api/controllers/wxapp/licheb/Employees.php | 24 +++++- api/controllers/wxapp/licheb/Protocol.php | 16 +++- api/controllers/wxapp/licheb/User.php | 14 +++- api/views/wxapp/licheb/html2pdf/car_fh.php | 4 +- api/views/wxapp/licheb/protocol/car_fh.php | 4 +- common/libraries/TcOrc.php | 18 ++--- common/libraries/receiver/Sign_entity.php | 4 +- .../receiver/Receiver_customers_model.php | 20 +++++ 16 files changed, 161 insertions(+), 148 deletions(-) delete mode 100644 api/controllers/Test.php diff --git a/admin/views/receiver/orders/get.php b/admin/views/receiver/orders/get.php index 849251c2..590caae7 100644 --- a/admin/views/receiver/orders/get.php +++ b/admin/views/receiver/orders/get.php @@ -50,8 +50,8 @@ -->
- 身份证正面 - 身份证反面 + 身份证正面 + 身份证反面
diff --git a/api/controllers/Test.php b/api/controllers/Test.php deleted file mode 100644 index 4b042ec2..00000000 --- a/api/controllers/Test.php +++ /dev/null @@ -1,76 +0,0 @@ -array( - "verify_peer"=>false, - "verify_peer_name"=>false, - ), - ); - $html = file_get_contents($url,false,stream_context_create($arrContextOptions)); - require_once COMMPATH.'/third_party/TCPDF/tcpdf.php'; - $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT,true, 'UTF-8', false); - $pdf->SetCreator(PDF_CREATOR); - $pdf->SetAuthor("jmcx"); - - $pdf->setPrintHeader(false); - - $pdf->setPrintFooter(false); - - $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); - - $pdf->SetMargins(PDF_MARGIN_LEFT, 5,PDF_MARGIN_RIGHT); - $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); - $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); - - $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); - $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); - $pdf->SetFont('stsongstdlight', '', 10); //设置中文显示 - $pdf->AddPage(); - $pdf->writeHTML($html, true, false, true, false, ''); - $pdf->Output($path.$filename,'F'); - } - - public function pdf2img(){ - $pdf = 'http://liche-api-dev.xiaoyu.com/temp/pdf/car_fh.pdf'; - $pdf2img_url = 'http://liche-api-dev.xiaoyu.com/jar/pdf2img'; - $this->load->library('mycurl'); - $url = $pdf2img_url.'?furl='.$pdf; - $res = $this->mycurl->httpGet($url); - var_dump($res); - } - - public function save_img(){ - $img = 'https://liche-api-dev.xiaoyu.com/pdf2img/2021-07-07/1889917037729102438059_0.png'; - //if(!$_FILES['file']){ - // echo '参数错误';exit; - //} - $this->load->library('receiver/sign_entity'); - //$res = $this->sign_entity->merge($img,$_FILES['file'],1050,1550,300); //协议 - $res = $this->sign_entity->test($img,$_FILES['file']=222,1050,1550,300); //协议 - //$res = $this->sign_entity->test($img,$base64_img,1050,200,300); //整车 - //$res = $this->sign_entity->test($img,$base64_img,1050,400,300); //确认单 - //$res = $this->sign_entity->test($img,$base64_img,300,1400,'','',false); //车辆交接信息 - echo $res; - } - -} diff --git a/api/controllers/wxapp/liche/Aptinfo.php b/api/controllers/wxapp/liche/Aptinfo.php index 0d8c0434..1c0e699e 100644 --- a/api/controllers/wxapp/liche/Aptinfo.php +++ b/api/controllers/wxapp/liche/Aptinfo.php @@ -111,39 +111,35 @@ class Aptinfo extends Wxapp{ $this->load->model('receiver/receiver_clues_model','clues_model'); $this->load->model('auto/auto_series_model'); + $uid = $this->session['uid']; $biz_id = $this->input_param('biz_id'); $series_id = $this->input_param('car_id');//车系id $city_code = $this->input_param('city_id'); $series_row = $this->auto_series_model->get(['id'=>$series_id]); + if($this->clues_model->count(['cf_id'=>$cf_id,'cf_uid'=>$uid,'app_id'=>$this->app_id,'status'=>0])){ + throw new Exception('您已预约', API_CODE_SUCCESS); + } $jsondata['info'] = [ 'biz_id' => $biz_id ? $biz_id : '', 'city_code' => $city_code ]; $cf_platform = 'wxapp'; - $where = [ - 'cf_id' => $cf_id, + $add_data = [ + 'name' => $this->session['nickname'], + 'mobile' => $this->session['mobile'], 'cf_uid' => $this->session['uid'], + 'cf_id' => $cf_id, 'app_id' => $this->app_id, + 'if_driver' => 1, 'cf_platform' => $cf_platform, + 'jsondata' => json_encode($jsondata,JSON_UNESCAPED_UNICODE), + 'c_time' => time() ]; - $row = $this->clues_model->get($where); - if(!$row){ - $add_data = [ - 'name' => $this->session['nickname'], - 'mobile' => $this->session['mobile'], - 'cf_uid' => $this->session['uid'], - 'cf_id' => $cf_id, - 'app_id' => $this->app_id, - 'if_driver' => 1, - 'cf_platform' => $cf_platform, - 'jsondata' => json_encode($jsondata,JSON_UNESCAPED_UNICODE), - 'c_time' => time() - ]; - $series_row['brand_id'] && $add_data['brand_id'] = $series_row['brand_id']; - $series_row['id'] && $add_data['s_id'] = $series_row['id']; - $this->clues_model->add($add_data); - } + $series_row['brand_id'] && $add_data['brand_id'] = $series_row['brand_id']; + $series_row['id'] && $add_data['s_id'] = $series_row['id']; + $this->clues_model->add($add_data); throw new Exception('预约成功', API_CODE_SUCCESS); } + } diff --git a/api/controllers/wxapp/liche/Car.php b/api/controllers/wxapp/liche/Car.php index 3ce92e3c..54238874 100644 --- a/api/controllers/wxapp/liche/Car.php +++ b/api/controllers/wxapp/liche/Car.php @@ -45,7 +45,7 @@ class Car extends Wxapp{ $version[] = [ 'id' => $val['id'], 'title' => $val['title'], - 'v' => $jsondata['v'], + 'v' => number_format($jsondata['v']).'元起', ]; }else{ //颜色 $color[] = [ @@ -62,7 +62,7 @@ class Car extends Wxapp{ 'title' => $row['series'].' '.$row['title'], 'color' => $color, 'version' => $version, - 'btn' => '支付¥9.9定金购车' + 'btn' => '支付¥5000定金购车' ]; return $data; } @@ -72,10 +72,15 @@ class Car extends Wxapp{ $this->load->model('receiver/receiver_clues_model','clues_model'); $this->load->model('apporder/order_purchase_model'); + $cf_id = 2; + $uid = $this->session['uid']; $s_id = $this->input_param('id'); //车系id $c_id = intval($this->input_param('c_id')); //颜色属性id $v_id = intval($this->input_param('v_id')); //车型属性id + if($this->clues_model->count(['cf_id'=>$cf_id,'cf_uid'=>$uid,'status'=>0])){ + throw new Exception('您已订购', API_CODE_INVILD_PARAM); + } $row = $this->auto_series_model-> get(['id'=>$s_id]); if(!$row){ throw new Exception('参数错误', API_CODE_INVILD_PARAM); @@ -104,8 +109,8 @@ class Car extends Wxapp{ 's_id' => $row['id'], 'name' => $this->session['nickname'], 'mobile' => $this->session['mobile'], - 'cf_uid' => $this->session['uid'], - 'cf_id' => 2, + 'cf_uid' => $uid, + 'cf_id' => $cf_id, 'app_id' => $this->app_id, 'cf_platform' => $cf_platform, 'jsondata' => json_encode($jsondata,JSON_UNESCAPED_UNICODE), @@ -116,7 +121,7 @@ class Car extends Wxapp{ throw new Exception('提交失败', API_CODE_INVILD_PARAM); } $order_id = ''; - $price = 9.9; + $price = 5000; $sid = create_order_no(350200, $this->app_key); if($color['jsondata']['img']){ $jsondata['cover'] = $color['jsondata']['img']; diff --git a/api/controllers/wxapp/liche/Contract.php b/api/controllers/wxapp/liche/Contract.php index a556a40d..6f3137c4 100644 --- a/api/controllers/wxapp/liche/Contract.php +++ b/api/controllers/wxapp/liche/Contract.php @@ -178,7 +178,7 @@ class Contract extends Wxapp{ break; case 3: //车辆交接 $sign_img = array_pop($imgs); - $res = $this->sign_entity->merge($sign_img,$img,300,1400,'','',false); + $res = $this->sign_entity->merge($sign_img,$img,400,1400,'','',false); if(!$res){ throw new Exception('签名失败', API_CODE_INVILD_PARAM); } diff --git a/api/controllers/wxapp/liche/User.php b/api/controllers/wxapp/liche/User.php index 9fac7dc1..8dbbfdf7 100644 --- a/api/controllers/wxapp/liche/User.php +++ b/api/controllers/wxapp/liche/User.php @@ -297,7 +297,7 @@ class User extends Wxapp{ if($ckcar_row['status']){ if($val['id']==5){ $state = 2; - $progressOpt = ['title'=> '合同签订','url'=>'/pages/mine/signContract/queRen?id='.$row['id']]; + $progressOpt = ['title'=> '确认车辆','url'=>'/pages/mine/signContract/queRen?id='.$row['id']]; }else{ $state = 1; } @@ -310,7 +310,7 @@ class User extends Wxapp{ if($delivery_row['status']){ $imgs = $this->orders_entity->get_sign_imgs($row['id'],[3]); }else{ - $progressOpt = ['title'=> '合同签订','url'=>'/pages/mine/signContract/jiaoJie?id='.$row['id']]; + $progressOpt = ['title'=> '交接车辆','url'=>'/pages/mine/signContract/jiaoJie?id='.$row['id']]; } break; default: @@ -417,4 +417,17 @@ class User extends Wxapp{ ]; return $data; } + + //判断用户报名 + protected function get_ck(){ + $this->load->model('receiver/receiver_clues_model','clues_model'); + $uid = $this->session['uid']; + $apt_count = $this->clues_model->count(['cf_uid'=>$uid,'cf_id'=>1,'status'=>0]);//预约试驾 + $dg_count = $this->clues_model->count(['cf_uid'=>$uid,'cf_id'=>2,'status'=>0]);//订购 + $data = [ + 'apt' => $apt_count ? 1 : 0, + 'dg' => $dg_count ? 1 : 0 + ]; + return $data; + } } diff --git a/api/controllers/wxapp/licheb/Cusorder.php b/api/controllers/wxapp/licheb/Cusorder.php index b472f142..b5f3370e 100644 --- a/api/controllers/wxapp/licheb/Cusorder.php +++ b/api/controllers/wxapp/licheb/Cusorder.php @@ -169,11 +169,11 @@ class Cusorder extends Wxapp{ ]; if($group_id==1){ //销售 - $where ["admin_id = {$uid} or admin_id=0"] = null; + $where ["admin_id"] = $uid; } if($keyword){ - $where["(name={$keyword}) or (mobile={$keyword})"] = null; + $where["(name='{$keyword}' or mobile='{$keyword}')"] = null; } strlen($status) && $where['status'] = $status; $fileds = 'id,name,mobile,car_json,brand_id,s_id,deposit,payway,status,c_time'; diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index a01b67d7..9a0fd496 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -257,6 +257,7 @@ class Customers extends Wxapp{ $size = $this->input_param('size'); $istop = $this->input_param('istop'); $iscall = $this->input_param('iscall'); + $unuse = $this->input_param('unuse'); //未派客户 !$page && $page = 1; !$size && $size = 10; @@ -274,12 +275,14 @@ class Customers extends Wxapp{ ]; if($group_id==1){ //销售 - $where ["admin_id = {$uid} or admin_id=0"] = null; + $where ["admin_id=$uid or admin_id=0"] = null; } if($s_time && $e_time){ $where['c_time >='] = strtotime($s_time); $where['c_time <='] = strtotime(date('Y-m-d 23:59:59',strtotime($e_time))); } + + $unuse && $where['admin_id'] = 0; strlen($istop) && $where['is_top'] = $istop; strlen($if_driver) && $where['if_driver'] = 1; strlen($status) && $where['status'] = $status; @@ -301,24 +304,13 @@ class Customers extends Wxapp{ ]; $admins = $this->app_user_model->map('id','',$where,'','','','id,uname'); } + //品牌车型 $brand_arr = array_unique(array_column($rows,'brand_id')); - $brand_ids = implode(',',$brand_arr); - if($brand_ids){ - $where = [ - "id in ({$brand_ids})" => null - ]; - $brands = $this->auto_brand_model->map('id','',$where,'','','','id,name'); - } + $brands = $this->auto_brand_model->get_map_by_ids($brand_arr,'id,name'); //车系车型 $series_arr = array_unique(array_column($rows,'s_id')); - $series_ids = implode(',',$series_arr); - if($series_ids){ - $where = [ - "id in ({$series_ids})" => null - ]; - $series = $this->auto_series_model->map('id','',$where,'','','','id,name'); - } + $series = $this->auto_series_model->get_map_by_ids($series_arr,'id,name'); foreach($rows as $key => $val){ $car_json = json_decode($val['car_json'],true); @@ -352,4 +344,35 @@ class Customers extends Wxapp{ ]; return $data; } + //派单给店员 + protected function put_admins(){ + $uname = $this->session['uname']; + $uid = $this->session['uid']; + $id_arr = $this->input_param('ids'); + $admin_id = $this->input_param('admin_id'); + + $admin = $this->app_user_model->get(['id'=>$admin_id,'status'=>1]); + if (!$ids || !$admin) { + throw new Hd_exception('参数错误', API_CODE_INVILD_PARAM); + } + + $ids = implode(',', $id_arr); + $ret = $this->customers_model->update(['admin_id' => $admin_id], ["id in ({$ids})" => null]); + if (is_bool($ret)) { + debug_log("[error]# " . $this->orders_model->db->last_query(), __FUNCTION__, $this->log_dir); + throw new Exception('分派失败', API_CODE_FAIL); + } + //写日志 + $this->load->model('receiver/receiver_clues_model','clues_model'); + $this->load->library('receiver/customers_entity'); + $customers = $this->customers_model->get_map_by_ids ($id_arr,'id,rid'); + foreach($id_arr as $val){ + if($customers[$val]['rid']){ //更新线索跟进人 + $this->clues_model->update(['admin_id'=>$admin_id,'status'=>2],['id'=>$customers[$val]['rid']]); + } + $log = "【$uname】分配客户"; + $this->customers_entity->add_log($val,$uid,$uname,$log); + } + throw new Exception('分配成功', API_CODE_SUCCESS); + } } diff --git a/api/controllers/wxapp/licheb/Employees.php b/api/controllers/wxapp/licheb/Employees.php index 6f3e7af8..754d1c90 100644 --- a/api/controllers/wxapp/licheb/Employees.php +++ b/api/controllers/wxapp/licheb/Employees.php @@ -20,10 +20,26 @@ class Employees extends Wxapp{ } public function get(){ - $where = [ - 'pid' => $this->session['uid'], - 'status>-1' => null - ]; + $ifconf = $this->input_param('ifconf'); + $page = $this->input_param('page'); + $size = $this->input_param('size'); + + !$page && $page = 1; + !$size && $size = 10; + $uid = $this->session['uid']; + + if($ifconf){ + $where = [ + "(pid=$uid or id=$uid)" => null, + 'status' => 1 + ]; + }else{ + $where = [ + 'pid' => $this->session['uid'], + 'status>' => -1 + ]; + } + $count = $this->app_user_model->count($where); $lists = []; if($count){ diff --git a/api/controllers/wxapp/licheb/Protocol.php b/api/controllers/wxapp/licheb/Protocol.php index 682505c9..c1e3195a 100644 --- a/api/controllers/wxapp/licheb/Protocol.php +++ b/api/controllers/wxapp/licheb/Protocol.php @@ -13,6 +13,9 @@ class Protocol extends CI_Controller{ parent::__construct($inputs, $app_key); $this->load->model('receiver/order/receiver_orders_model','orders_model'); $this->load->model('receiver/order/receiver_order_contracts_model','contracts_model'); + $this->load->model('receiver/order/receiver_order_agents_model','agents_model'); + $this->load->model('receiver/order/receiver_order_loans_model','loans_model'); + $this->load->model('receiver/order/receiver_order_ckcars_model','ckcars_model'); $this->load->model('auto/auto_series_model'); $this->load->model('auto/auto_brand_model'); $this->load->model("items/items_model"); @@ -54,7 +57,6 @@ class Protocol extends CI_Controller{ //车辆信息确认单 public function car_ck(){ $wxapp = $this->input->get('wxapp'); - $this->load->model('receiver/order/receiver_order_ckcars_model','ckcars_model'); $id = $this->input->get('id'); $row = $this->orders_model->get(['id'=>$id]); if($row){ @@ -74,12 +76,12 @@ class Protocol extends CI_Controller{ } //车辆交接信息 public function car_fh(){ + $this->load->model('app/licheb/app_licheb_users_model'); $wxapp = $this->input->get('wxapp'); $id = $this->input->get('id'); + $row = $this->orders_model->get(['id'=>$id]); - $this->load->model('receiver/order/receiver_order_agents_model','agents_model'); - $this->load->model('receiver/order/receiver_order_loans_model','loans_model'); - $row['agent'] = $this->agents_model->get(['o_id'=>$id]); + $agent = $this->agents_model->get(['o_id'=>$id]); $contract = $this->contracts_model->get(['o_id'=>$id,'type'=>3]); $items = $this->items_model->get(['id'=>$row['item_id']],'vin'); if($row){ @@ -90,11 +92,17 @@ class Protocol extends CI_Controller{ $brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name'); $series = $this->auto_series_model->get(['id'=>$row['s_id']],'name'); $car_json = json_decode($row['car_json'],true); + $info_json = json_decode($row['info_json'],true); $color = isset($car_json['color']) ? $car_json['color']['title'] : ''; $version = isset($car_json['version']) ? $car_json['version']['title'] : ''; $row['brand_name'] = $brand['name'].$series['name'].' '.$version; $row['color'] = $color; + $row['cardid'] = $info_json['cardid']; + //获取销售 + $admin = $this->app_licheb_users_model->get(['id'=>$row['admin_id']],'uname'); + $row['uname'] = $admin['uname']; } + $row['agent'] = $agent; $row['day'] = $contract ? date('Y年m月d日',$contract['c_time']):date('Y年m月d日'); $row['cid'] = $contract['cid']; $row['vin'] = $items['vin']; diff --git a/api/controllers/wxapp/licheb/User.php b/api/controllers/wxapp/licheb/User.php index 42384575..886b14e3 100644 --- a/api/controllers/wxapp/licheb/User.php +++ b/api/controllers/wxapp/licheb/User.php @@ -81,12 +81,16 @@ class User extends Wxapp{ $uid = $this->session['uid']; $user = $this->app_user_model->get(array('id' => $uid)); - + //获取所属店铺字段 + $this->load->model("biz/biz_model"); + $biz = $this->biz_model->get(['id'=>$this->session['biz_id']],'biz_name'); + $data = array( 'uid' => $uid, 'uname' => $user['uname'], 'mobile' => $user['mobile'], - 'group_id' => $user['group_id'] + 'group_id' => $user['group_id'], + 'biz_name' => $biz['biz_name'] ? $biz['biz_name'] : '' ); return $data; @@ -97,17 +101,21 @@ class User extends Wxapp{ */ protected function get_cal(){ $uid = $this->session['uid']; + $biz_id = $this->session['biz_id']; $this->load->model('receiver/receiver_customers_model','customers_model'); $this->load->model('receiver/order/receiver_orders_model','orders_model'); $wl_count = $this->customers_model->count(['status'=>0,'admin_id'=>$uid]); $gz_count = $this->customers_model->count(['status>-1'=>null,'is_top'=>1,'admin_id'=>$uid]); $sign_count = $this->orders_model->count(['status'=>0,'admin_id'=>$uid]); $loan_count = $this->orders_model->count(['status'=>1,'admin_id'=>$uid]); + //未派单客户 + $unuse_count = $this->customers_model->count(['admin_id'=>0,'biz_id'=>$biz_id]); $data = [ 'wl_count' => $wl_count, 'gz_count' => $gz_count, 'sign_count' => $sign_count, - 'loan_count' => $loan_count + 'loan_count' => $loan_count, + 'unuse_count' => $unuse_count ]; return $data; } diff --git a/api/views/wxapp/licheb/html2pdf/car_fh.php b/api/views/wxapp/licheb/html2pdf/car_fh.php index ef2ae421..b7c3d41b 100644 --- a/api/views/wxapp/licheb/html2pdf/car_fh.php +++ b/api/views/wxapp/licheb/html2pdf/car_fh.php @@ -15,7 +15,7 @@
- 身份证: + 身份证: 联系电话: @@ -124,7 +124,7 @@
-
销售顾问:
+
销售顾问:
日期:
diff --git a/api/views/wxapp/licheb/protocol/car_fh.php b/api/views/wxapp/licheb/protocol/car_fh.php index 3cf55049..8f07b341 100644 --- a/api/views/wxapp/licheb/protocol/car_fh.php +++ b/api/views/wxapp/licheb/protocol/car_fh.php @@ -19,7 +19,7 @@
- 身份证: + 身份证: 联系电话: @@ -128,7 +128,7 @@
-
销售顾问:
+
销售顾问:
日期:
diff --git a/common/libraries/TcOrc.php b/common/libraries/TcOrc.php index daa3f162..e71532d1 100644 --- a/common/libraries/TcOrc.php +++ b/common/libraries/TcOrc.php @@ -42,15 +42,15 @@ class TcOrc{ */ public function IdentityCard($imageUrl,$CardSide='FRONT'){ //dev测试 - $this->ci->load->library('mycurl'); - $debug_url = 'http://104.194.86.23:8889/index.php'; - $params = [ - 'ImageUrl' => $imageUrl, - 'CardSide' => $CardSide - ]; - $result = $this->ci->mycurl->httpGet($debug_url,$params); - $result = json_decode($result,true); - return $result; + //$this->ci->load->library('mycurl'); + //$debug_url = 'http://104.194.86.23:8889/index.php'; + //$params = [ + // 'ImageUrl' => $imageUrl, + // 'CardSide' => $CardSide + //]; + //$result = $this->ci->mycurl->httpGet($debug_url,$params); + //$result = json_decode($result,true); + //return $result; try { $cred = new Credential($this->accessKeyId, $this->accessKeySecret); $httpProfile = new HttpProfile(); diff --git a/common/libraries/receiver/Sign_entity.php b/common/libraries/receiver/Sign_entity.php index 00077b31..e6748870 100644 --- a/common/libraries/receiver/Sign_entity.php +++ b/common/libraries/receiver/Sign_entity.php @@ -42,7 +42,7 @@ class Sign_entity{ !$s_path && $s_path = FCPATH.'temp/'.md5('sign'.$file_name).'.jpg'; $yhdata = file_get_contents($user_file,false,stream_context_create($arrContextOptions)); - $yh_image = Image::fromData($yhdata)->cropResize(150,150); + $yh_image = Image::fromData($yhdata)->cropResize(150,150)->rotate(-90); //原始签名文件 @@ -98,7 +98,7 @@ class Sign_entity{ if(!$res){ return false; } - $yh_image = Image::open($imgPath)->cropResize(150,150); + $yh_image = Image::open($imgPath)->cropResize(150,150)->rotate(-90); //原始签名文件 diff --git a/common/models/receiver/Receiver_customers_model.php b/common/models/receiver/Receiver_customers_model.php index 9d4903af..1bba1a7b 100644 --- a/common/models/receiver/Receiver_customers_model.php +++ b/common/models/receiver/Receiver_customers_model.php @@ -17,6 +17,26 @@ class Receiver_customers_model extends HD_Model { parent::__construct($this->table_name, 'default'); } + + /** + * Notes:根据id获取数据 + * @param $ids array() id 数组 + * @param string $fileds + * @return array + */ + public function get_map_by_ids($ids, $fileds = '') + { + $rows = []; + if ($ids) { + $ids = array_filter($ids); + $cf_ids = implode(',', $ids); + $where = [ + "id in ($cf_ids)" => null + ]; + $rows = $this->map('id', '', $where, '', '', '', $fileds); + } + return $rows; + } public function get_status(){ return $this->status_arr;