|
@@ -77,6 +77,7 @@ class Source extends Frontend
|
|
|
//print_r($info);
|
|
|
|
|
|
$code_arr = [];
|
|
|
+ $code_arr['orderid'] = encrypt($orderid);
|
|
|
$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'].'具体信息参见下方资料';
|
|
@@ -114,20 +115,36 @@ class Source extends Frontend
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
|
|
|
+ //
|
|
|
public function info()
|
|
|
{
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+ //订单检疫照片
|
|
|
+ public function inspect()
|
|
|
+ {
|
|
|
+ $id = $code = $this->request->request('id');
|
|
|
+ if (!$id) {
|
|
|
+ $this->error("ID为空,非法访问!");
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+
|
|
|
+ $order = new Order();
|
|
|
+ $orderinfo = $order->where('orderid', $id)->find();
|
|
|
+ $this->companyinfo($orderinfo);
|
|
|
+ $this->view->assign('orderinfo', $orderinfo);
|
|
|
+ return $this->view->fetch();
|
|
|
+ }
|
|
|
|
|
|
private function companyinfo(&$companyinfo)
|
|
|
{
|
|
|
- if ($companyinfo['images']) {
|
|
|
+ if (isset($companyinfo['images']) && $companyinfo['images']) {
|
|
|
$arr = explode(',', $companyinfo['images']);
|
|
|
} else {
|
|
|
$arr[] = '/assets/code/zzry1.jpg';
|
|
|
}
|
|
|
$companyinfo['imgs'] = $arr;
|
|
|
- if ($companyinfo['banner_images']) {
|
|
|
+ if (isset($companyinfo['banner_images']) && $companyinfo['banner_images']) {
|
|
|
$banners = explode(',', $companyinfo['banner_images']);
|
|
|
$companyinfo['banners'] = $banners[0];
|
|
|
} else {
|