pengchanglu 3 年之前
父節點
當前提交
8a448724af
共有 2 個文件被更改,包括 22 次插入31 次删除
  1. 12 5
      application/index/controller/Source.php
  2. 10 26
      application/index/view/source/code.html

+ 12 - 5
application/index/controller/Source.php

@@ -32,12 +32,13 @@ class Source extends Frontend
             $this->error("CODE为空,非法访问!");
             exit;
         }
-        $id = intval(decrypt($code));
+        $code_str = decrypt($code);
+        $id = intval($code_str);
         if (!$id) {
             $this->error("参数错误!!");
         }
         //$id = 1;
-        echo $id;
+        //echo $id;
         $code = new Code();
         $codeinfo = $code->find($id);
         if (!$codeinfo) {
@@ -45,7 +46,7 @@ class Source extends Frontend
             exit;
         }
         $orderid = $codeinfo['orderid'];
-        echo $orderid;
+        //echo $orderid;
 
         if (!$orderid) {
             $this->error("未绑定订单~");
@@ -57,7 +58,7 @@ class Source extends Frontend
         if (!$info) {
             $order = new Order();
             $orderinfo = $order->where('orderid', $orderid)->find();
-            $orderinfo['text'] = 'sss';
+            $orderinfo['text'] = '';
             $info['orderinfo'] = $orderinfo;
 
             $company = new Company();
@@ -74,8 +75,14 @@ class Source extends Frontend
 
             Cache::set($key, $info, 60);//一小时缓存
         }
-        print_r($info);
+        //print_r($info);
 
+        $code_arr = [];
+        $code_arr['code'] = $code_str;
+        $code_arr['time'] = date('Y-m-d H:i:s');
+        $code_arr['text'] = '亲爱的消费者,您查询的溯源码是:'.$code_str.'这一批猪肉产品是由'.$info['companyinfo']['name'].'加工屠宰,产品各项检测指标符合相关标准要求,请放心选购。肉品加工地:安徽。查询时间:'.$code_arr['time'].'具体信息参见下方资料';
+
+        $this->view->assign('code', $code_arr);
         $this->view->assign('orderinfo', $info['orderinfo']);
         $this->view->assign('companyinfo', $info['companyinfo']);
         $this->view->assign('supplier', $info['supplier']);

文件差異過大導致無法顯示
+ 10 - 26
application/index/view/source/code.html


部分文件因文件數量過多而無法顯示