webmain/model/flow/goodsModel.php
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
class flow_goodsClassModel extends flowModel
{
public $base;
public function initModel()
{
$this->base = m('goods');
}
protected function flowchangedata(){
$this->rs['typeid'] = $this->base->gettypename($this->rs['typeid']);
}
//导入数据的测试显示
public function flowdaorutestdata()
{
return array(
'typeid' => '办公耗材/笔',
'name' => '红色粉笔',
'num' => 'WP-829',
'guige' => '红色',
'xinghao' => '5厘米',
'price' => '0.1',
'unit' => '盒',
'stockcs' => '20',
);
}
public function flowxiangfields(&$fields)
{
$fields['stock'] = '总库存';
$where = '';
if(ISMORECOM){
$comid = arrvalue($this->rs,'comid','0');
$where = ' and `comid`='.$comid.'';
}
$kcrow = m('godepot')->getall('1=1'.$where.'','*','`sort`');
foreach($kcrow as $k1=>$rs1){
$fields['stock_'.$rs1['id'].''] = $rs1['depotname'];
}
return $fields;
}
//
public function flowrsreplace($rs, $lx=0)
{
if(isset($rs['typeid']) && is_numeric($rs['typeid']))
$rs['typeid'] = $this->base->gettypename($rs['typeid']);
//详情页下显示对应仓库库存
if($lx==1){
$drows = $this->db->getall("SELECT `depotid`,sum(count)count FROM `[Q]goodss` where aid=".$rs['id']." and `status`=1 GROUP BY `depotid`");
foreach($drows as $k1=>$rs1)$rs['stock_'.$rs1['depotid'].''] = $rs1['count'];
}
return $rs;
}
后面还有 51 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
