public ActionResult 动作方法(){ var otherController = DependencyResolver.Current.GetService<另一个控制器的类名>(); var result = otherController.另一个动作方法(); return result;}…
前段时间因为业务需求,使用TP的command开发了几个模块,期间测试一下在控制器中调用命令的方式,发现一些问题记录一下 官方文档: <?php namespace app\index\controller; use think\Console; use think\Controller; class Index extends Controller { public function hello($name) { $output = Console::call('hello ' . $name…
原文链接:http://www.jb51.net/article/20160.htm 实际项目当中经常需要在一个存储过程中调用另一个存储过程返回的游标,本文列举了两种情况讲述具体的操作方法. 第一种情况是返回的游标是某个具体的表或视图的数据,如: CREATE OR REPLACE PROCEDURE P_TESTA ( PRESULT OUT SYS_REFCURSOR ) AS BEGIN OPEN PRESULT FOR SELECT * FROM USERS; END P_TESTA;…