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

相关帖子
speed | 最后回帖 2016-08-29 14:11 石洋洋
心软的眼镜 | 最后回帖 2024-02-19 14:09 禅道-阿龙
陈煜晟 | 最后回帖 2021-08-13 09:08 漂流
王海甘 | 最后回帖 2020-10-13 17:31 禅道-李锡碧
Swire | 最后回帖 2017-12-22 13:13 石洋洋
摇一会儿 | 最后回帖 2024-05-20 08:31 王林


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


