1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
class flow_bookClassModel extends flowModel
{
public function flowrsreplace($rs,$isv=0)
{
if(isset($rs['typeid']))$rs['typeid'] = $this->db->getmou('[Q]option','name',"`id`='".$rs['typeid']."'");
return $rs;
}
protected function flowbillwhere($uid, $lx)
{
$where = '';
$typeid = $this->rock->post('typeid','0');
$key = $this->rock->post('key');
if($typeid!='0'){
$where .= ' and `typeid`='.$typeid.'';
}
if($key != '')$where.=" and (`title` like '%$key%' or `author` like '%$key%')";
return array(
'where' => $where,
'order' => 'optdt desc'
);
}
//导入数据的测试显示
public function flowdaorutestdata()
{
return array(
'typeid' => '计算机/编程',
'title' => 'PHP从入门到放弃',
'num' => 'TS-003',
'author' => '磐石',
'chuban' => '信呼开发团队',
'cbdt' => '2017-01-17',
'price' => '49.9',
'shul' => '5',
'weizhi' => '不知道',
'isbn' => 'PANSHI-001',
);
}
//导入之前
public function flowdaorubefore($rows)
{
$inarr = array();
$num = 'booktype';
if(ISMORECOM && $cnum=$this->adminmodel->getcompanynum())$num.='_'.$cnum.'';
foreach($rows as $k=>$rs){
$rs['typeid'] = $this->option->gettypeid($num,$rs['typeid']);
$inarr[] = $rs;
}
return $inarr;
}
}