现在开始记录怎么做Expense系统 [ 新手入门 ]
刚开始接触Yii,想用Yii做公司人员的费用跟踪系统,以前在用过Concur,想模仿个那种功能的。 结构:
Expense Type( Expense Type ID, Expense Type Name, Expense Type Level 1, Expense Type Level 2, Expense Description)
Expense Record(Expense Record ID, Expense Owner, Expense Type, Currency, Amount, Location, Description, Remark, Time Stamp )
Expense Report()
新建一个Expense Report,勾选Expense Record,生成Expense Report
大致思路是这样
共 2 条回复
-
wamp下装了个XAMPP
建DB Study
建
table expenselist
table eprecord上述在phpMyaAdmin中完成
用GII命令行做了
model expenselist
crud expenselistmodel eprecord
crud eprecord在views/layouts/main.php中添加
array('label'=>'Expense Record', 'url'=>array('/eprecord/index')), array('label'=>'Expense Type', 'url'=>array('/expenselist/index')),
然后就可以看到连个网页,感觉很神奇,但是Label默认为table中的字段。
想改成自己想要的Label,先是直接在views/eprecord/_form.php中直接改,但是提示为必填的红色*消失了,后来在
models/eprecord.php 找到public function attributeLabels() { return array( 'eprid' => 'Expense Record ID', 'epruid' => 'Expense Owner ID', 'ept' => 'Expense Type', 'currency' => 'Currency', 'amount' => 'Amount', 'ets' => 'Time Stamp', 'eloc' => 'Location', 'eprr' => 'Remark', ); }
可以在这边修改为我想用的Label
attajob Shanghai
注册时间:2011-12-09
最后登录:1970-01-01
在线时长:0小时0分
最后登录:1970-01-01
在线时长:0小时0分
- 粉丝0
- 金钱240
- 威望0
- 积分240