|
@@ -0,0 +1,73 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace app\admin\controller;
|
|
|
+
|
|
|
+use app\BaseController;
|
|
|
+use think\App;
|
|
|
+use think\facade\Db;
|
|
|
+
|
|
|
+class Title extends BaseController
|
|
|
+{
|
|
|
+ public $post = "";
|
|
|
+ public function __construct(App $app)
|
|
|
+ {
|
|
|
+ parent::__construct($app);
|
|
|
+ $this->post= $this->request->post();
|
|
|
+ }
|
|
|
+ public function creater(){
|
|
|
+ $companyNo = isset($this->post['companyNo']) && $this->post['companyNo'] !==""? trim($this->post['companyNo']):"";
|
|
|
+ if($companyNo==""){
|
|
|
+ return error_show(1002,"参数companyNo不能为空");
|
|
|
+ }
|
|
|
+ $invoice_title = isset($this->post['invoice_title']) && $this->post['invoice_title'] !=="" ? trim($this->post['invoice_title']):"";
|
|
|
+ if($invoice_title==""){
|
|
|
+ return error_show(1002,"参数invoice_title不能为空");
|
|
|
+ }
|
|
|
+ $invoice_people = isset($this->post['invoice_people']) && $this->post['invoice_people'] !== ""? trim($this->post['invoice_people']):"";
|
|
|
+ if($invoice_people==""){
|
|
|
+ return error_show(1002,"参数invoice_people不能为空");
|
|
|
+ }
|
|
|
+ $invoice_code = isset($this->post['invoice_code']) && $this->post['invoice_code'] !==""? trim($this->post['invoice_code']):"";
|
|
|
+ if($invoice_code==""){
|
|
|
+ return error_show(1002,"参数invoice_code不能为空");
|
|
|
+ }
|
|
|
+ $invoice_bank = isset($this->post['invoice_bank']) && $this->post['invoice_bank'] !==""? trim($this->post['invoice_bank']):"";
|
|
|
+ if($invoice_bank==""){
|
|
|
+ return error_show(1002,"参数invoice_bank不能为空");
|
|
|
+ }
|
|
|
+ $invoice_bankNo = isset($this->post['invoice_bankNo']) && $this->post['invoice_bankNo'] !==""? trim($this->post['invoice_bankNo']):"";
|
|
|
+ if($invoice_bankNo==""){
|
|
|
+ return error_show(1002,"参数invoice_bankNo不能为空");
|
|
|
+ }
|
|
|
+ $invoice_addr = isset($this->post['invoice_addr']) && $this->post['invoice_addr'] !==""? trim($this->post['invoice_addr']):"";
|
|
|
+ if($invoice_addr==""){
|
|
|
+ return error_show(1002,"参数invoice_addr不能为空");
|
|
|
+ }
|
|
|
+ $invoice_mobile = isset($this->post['invoice_mobile']) && $this->post['invoice_mobile'] !==""? trim($this->post['invoice_mobile']):"";
|
|
|
+ if($invoice_mobile==""){
|
|
|
+ return error_show(1002,"参数invoice_mobile不能为空");
|
|
|
+ }
|
|
|
+ $status = isset($this->post['status']) && $this->post['status'] !==""? trim($this->post['status']):"1";
|
|
|
+ $data =[
|
|
|
+ "companyNo"=>$companyNo,
|
|
|
+ "invoice_title"=>$invoice_title,
|
|
|
+ "invoice_people"=>$invoice_people,
|
|
|
+ "invoice_code"=>$invoice_code,
|
|
|
+ "invoice_bank"=>$invoice_bank,
|
|
|
+ "invoice_bankNo"=>$invoice_bankNo,
|
|
|
+ "invoice_addr"=>$invoice_addr,
|
|
|
+ "invoice_mobile"=>$invoice_mobile,
|
|
|
+ "status"=>$status,
|
|
|
+ "is_del"=>0,
|
|
|
+ "addtime"=>date("Y-m-d H:i:s"),
|
|
|
+ "updatetime"=>date("Y-m-d H:i:s")
|
|
|
+ ];
|
|
|
+ $info = Db::name('customer_title')->insert($data);
|
|
|
+ if($info){
|
|
|
+ return error_show(0,"新建成功");
|
|
|
+ }else{
|
|
|
+ return error_show(1002,"新建失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|