80183
新建表问题
回帖数 1
阅读数 2577
发表时间 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 厦大 最后编辑
联系我们
联系人
高丽亚/高级客户经理
电话(微信)
17667930330
QQ号码
3645260865
联系邮箱
gaoliya@chandao.com

相关帖子
水月居 | 最后回帖 2018-07-14 10:14 2442517155
廖荣玄 | 最后回帖 2020-09-24 16:00 石洋洋
赵找找 | 最后回帖 2019-11-06 13:41 石洋洋
刘畅 | 最后回帖 2023-06-07 10:37 金凯
Kola | 最后回帖 2017-07-03 11:29 石洋洋
冯凌福 | 最后回帖 2017-12-07 08:33 禅道-李锡碧


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


