禅道扩展
334
数据插入问题已解决 悬赏5积分
提问者厦大
答案数1
阅读数3182
发表时间2011-06-20 14:59:29
呵呵,又来打扰春哥了!
提交表单时,显示"稍候...." 然后就不动了
数据没有写到表里,company字段没有特殊处理,想请教春哥是那里出了问题
代码参考产品里的productplan的相应方法
//model
public function createCustomer($planID)
{
$plan = fixer::input('post')->stripTags('person')->get();
$this->dao->insert(TABLE_CUSTOMER)->data($plan)->exec();
if(!dao::isError()) return $this->dao->lastInsertID();
}
//control
public function createCustomer($planID = '')
{
if(!empty($_POST))
{
$cID = $this->productplan->createCustomer();
if(dao::isError()) die(js::error(dao::getError()));
$this->loadModel('action')->create('productplan', $planID, 'opened');
die(js::locate($this->createLink('productplan', 'viewcustomer', "planID=$planID"), 'parent'));
}
[p]
$plan = $this->productplan->getByID($planID);
$this->commonAction($plan->product);
$this->view->header->title = $this->lang->productplan->createCustomer;
$this->view->position[] = $this->lang->productplan->createCustomer;
$this->display();[/p] }
--customer表
CREATE TABLE `customer` (
`id` mediumint(8) NOT NULL ,
`company` mediumint(8) NULL ,
`person` char(30) NULL ,
`position` char(16) NULL ,
`gendar` enum('') NULL ,
`phone` char(11) NULL ,
`tel` char(20) NULL ,
`email` char(90) NULL ,
PRIMARY KEY (`id`),
INDEX `company` (`company`) USING BTREE
)
ENGINE=MyISAM
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=3
CHECKSUM=0
ROW_FORMAT=DYNAMIC
DELAY_KEY_WRITE=0
;
提交表单时,显示"稍候...." 然后就不动了
数据没有写到表里,company字段没有特殊处理,想请教春哥是那里出了问题
代码参考产品里的productplan的相应方法
//model
public function createCustomer($planID)
{
$plan = fixer::input('post')->stripTags('person')->get();
$this->dao->insert(TABLE_CUSTOMER)->data($plan)->exec();
if(!dao::isError()) return $this->dao->lastInsertID();
}
//control
public function createCustomer($planID = '')
{
if(!empty($_POST))
{
$cID = $this->productplan->createCustomer();
if(dao::isError()) die(js::error(dao::getError()));
$this->loadModel('action')->create('productplan', $planID, 'opened');
die(js::locate($this->createLink('productplan', 'viewcustomer', "planID=$planID"), 'parent'));
}
[p]
$plan = $this->productplan->getByID($planID);
$this->commonAction($plan->product);
$this->view->header->title = $this->lang->productplan->createCustomer;
$this->view->position[] = $this->lang->productplan->createCustomer;
$this->display();[/p] }
--customer表
CREATE TABLE `customer` (
`id` mediumint(8) NOT NULL ,
`company` mediumint(8) NULL ,
`person` char(30) NULL ,
`position` char(16) NULL ,
`gendar` enum('') NULL ,
`phone` char(11) NULL ,
`tel` char(20) NULL ,
`email` char(90) NULL ,
PRIMARY KEY (`id`),
INDEX `company` (`company`) USING BTREE
)
ENGINE=MyISAM
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=3
CHECKSUM=0
ROW_FORMAT=DYNAMIC
DELAY_KEY_WRITE=0
;
禅道版本:2.0
安装包类型:
操作系统:Windows 7
客户端浏览器:Firefox
答案列表
🍟 config/my.php,打开debug。然后在页面的下方会出现一个红色的区块。然后在这个区块右键点击,查看本帧,或者本框架源代码,就可以看到相应的错误了。 还有要学会看错误日志。论坛里面的发贴自己回一下。下次不要重复发贴提问。
回复
|
联系我们
联系人
杨苗/高级客户经理
电话(微信)
13165050229
QQ号码
2692096539
联系邮箱
yangmiao@chandao.com