80183
新建表问题
回帖数 1
阅读数 2597
发表时间 2011-06-20 14:58:11
呵呵,又来打扰春哥了!
提交表单时,显示"稍候...." 然后就不动了
数据没有写到表里,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'));
}
--customer表
CREATE TABLE `customer` (
`id` mediumint(8) NOT NULL ,
`company` mediumint(8) NULL ,
`person` char(30) NULL ,
`position` char(16) NULL ,
`gendar` enum('m','f') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'm' ,
`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'));
}
$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();
--customer表
CREATE TABLE `customer` (
`id` mediumint(8) NOT NULL ,
`company` mediumint(8) NULL ,
`person` char(30) NULL ,
`position` char(16) NULL ,
`gendar` enum('m','f') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'm' ,
`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
;
2011-06-20 15:03:23 厦大 最后编辑
联系我们
联系人
魏中显/高级客户经理
电话(微信)
18561939726
QQ号码
1746749398
联系邮箱
weizhongxian@chandao.com

相关帖子
斯文 | 最后回帖 2018-04-11 11:13 王林
听话的消防车 | 最后回帖 2024-10-16 09:43 禅道-李锡碧
乐润-小戴 | 最后回帖 2019-01-15 11:24 禅道-李锡碧
龚先生 | 最后回帖 2017-03-05 12:15 16it
riverdance | 最后回帖 2017-08-25 17:12 石洋洋
speed | 最后回帖 2016-08-29 14:11 石洋洋



精品资料包
1V1产品演示
免费试用增强功能
专属顾问答疑支持


