ThinkPHP之跨模块调用页面找不到的问题

今天在做跨模块的时候,发现始终出问题,页面找不到,后来发现需要这么改。

比如A模块调用B模块的index方法

<?php
import("@.Action.Admin.CustomerAction");

class TransactionAction extends AdminCommAction{
public function index(){
$transaction_id = Session::get("transaction_id");
$station_id = getStationId();
$customer_id = Session::get("cur_customer");
if(!isset($customer_id)){
R("Customer", "index", "Admin");
}

if(!isset($transactionId)){
$data['store_id'] = $this->store_id;

}
//$this->display("point-of-sale");
}
}
?>

另一个模块中

<?
public function index(){
$customerModel = D('customer');
$where['enable']=1;
$getPage=changePage($customerModel,$where,9);

$resultlist = $customerModel->where("enable = 1")->page($getPage. ',9')->select();
foreach($resultlist as $key=>$value){
$customer_id = $resultlist[$key]['customer_id'];
$resultlist[$key]['itemsold'] = Count::getTotalItemSold($customer_id);
$resultlist[$key]['orderd'] = Count::getOrderd($customer_id);
$resultlist[$key]['latefees'] = Count::getLateFeesOutstanding($customer_id);
$resultlist[$key]['totalorder'] = Count::getTotalOrderNumber($customer_id);
}

$total = $customerModel->where("enable = 1")->count();
$Page = new Page($total,9);
$this->assign("resultList",$resultlist);
$this->assign("page",$Page->show());
$this->display("Customer/CustomerMan"); //这个很重要,否则会找不到页面
}
?>




原文地址:https://www.cnblogs.com/hongchenok/p/2186559.html