請幫我用我簡單的cakephp應用程序。cakephp傳遞函數請參閱我的解釋請
我有一個products_warehouses表:
--
-- Table structure for table `products_warehouses`
--
CREATE TABLE IF NOT EXISTS `products_warehouses` (
`id` int(5) NOT NULL auto_increment,
`product_id` int(5) NOT NULL,
`buyprice` decimal(8,2) NOT NULL,
`sellprice` decimal(8,2) NOT NULL,
`date_received` date NOT NULL,
`total_stock_received` int(3) NOT NULL,
`stock_on_hand` int(3) NOT NULL,
`stock_to_transfer` int(3) default NULL,
`created` datetime NOT NULL,
`modified` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
我想是的,我有一個傳遞函數,這樣,當我轉移項目。它會自動轉到products_showrooms表並從倉庫stock_to_tranfer字段將被添加到從products_showrooms表默認爲0的stock_received:
這裏是products_showrooms表
--
-- Table structure for table `products_showrooms`
--
CREATE TABLE IF NOT EXISTS `products_showrooms` (
`product_warehouse_id` int(5) NOT NULL,
`stock_on_hand` int(2) NOT NULL,
`stock_received` int(2) NOT NULL,
`date_received` date NOT NULL,
PRIMARY KEY (`product_warehouse_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
誰能幫我這個?。這些表應該有關係嗎?
有人可以爲我提供transfer()函數的正確代碼嗎? 我應該在這兩個表格的模型和控制器中放置什麼?..
謝謝..請幫助我。
你必須先閱讀http://book.cakephp.org/。給我們什麼是你確切的問題,而不是你想要的。 – 2010-10-29 07:34:02
我們不會爲你建立一些東西。如果您遇到困難,我們可以幫助您。 – Nigel 2010-10-29 07:47:03
除了第一行外,這裏沒有特定的CakePHP。你需要閱讀一本基本的MySql/PHP書。 – Leo 2010-10-29 12:00:41