RiskGuaranteeController.class.php 993 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Home\Controller;
  3. use Think\Controller;
  4. include '../Common/function.php';
  5. class RiskGuaranteeController extends ComController {
  6. public function index(){
  7. $data =I();
  8. $company_code=$data['companyid'];
  9. $sql="select * from ytiot_contract where company_code='".$company_code."'";
  10. $res=add66($sql);
  11. if (!empty($res)){
  12. $company_name=M()->query("select owner_name from sp_owner_company where owner_id='".$company_code."'");
  13. if ($res[0]['status']==0){
  14. $res[0]['status']='未启用';
  15. }elseif ($res[0]['status']==1){
  16. $res[0]['status']='启用';
  17. }
  18. $a=1;
  19. }else{
  20. $a=0;
  21. }
  22. $this->assign('a',$a);
  23. $this->assign('company_name',$company_name[0]['owner_name']);
  24. $this->assign('company_code',$company_code);
  25. $this->assign('res',$res[0]);
  26. $this->display('Index/risk_guarantee_details');
  27. }
  28. }