文件
mashangyoujiu/Application/Common/Model/SWarehousingRecordModel.class.php

59 行
2.8 KiB
PHP
可执行文件

<?php
/*
* 门店入库单模型 - 数据对象模型
*/
namespace Common\Model;
//[1.4.98]
use Think\Model;
class SWarehousingRecordModel extends JBaseModel
{
protected $tableName = 'retail_store_warehousing_record';
protected $fields = array(
'id', //int(11) NOT NULL AUTO_INCREMENT,
'merchant_id', //int(11) DEFAULT '0' COMMENT '商户id',
'store_id', //门店id
'source_store_id', //调拨的门店id
'stock_out_id', //调拨入库的出库单id
'warehouse_id', //int(11) DEFAULT '0' COMMENT '仓库id',
'supplier_id', //int(11) DEFAULT '0' COMMENT '供货商id',
'order_number', //varchar(255) DEFAULT '' COMMENT '订单号',
'goods_species', //int(11) DEFAULT '0' COMMENT '商品总种类',
'money_total', // decimal(10,2) DEFAULT '0.00' COMMENT '金额',
'real_goods_species', //实际的入库种类
'real_money_total', //实际的入库金额
'remarks', //text COMMENT '备注',
'status', //tinyint(1) DEFAULT '0' COMMENT '0未入库 1入库成功',
'type', //入库类型 0其他入库 1采购入库 2补货入库 3盘盈入库 4商户调拨入库 5其他门店调拨入库 6该门店申请调拨入库
'add_time', //varchar(10) DEFAULT '' COMMENT '入库时间',
'allocation_time', //调拨时间
'examine_status', //门店调拨入库商户审核 0未审核 1审核通过 2审核失败
'operator_id', //操作人员id
'operator_type', //操作人身份 0 后台操作人(包括商户与店长) 1收银员
'refuse_goods_species', //拒收的商品种数
'refuse_total_stock_money', //拒收出库的金额
'refuse_time', //拒收的时间
'refuse_status', //1没有拒收 2有拒收
'refuse_total_cost_money', //拒收成本价合计
);
/**
* 商户调拨门店,门店入库的验证
* @param $id
* @return bool
*/
public function merchant_param_verify($id)
{
$stock_out_id = $this->getFindField(array('id' => $id), "stock_out_id");
$warehousing_status = D('StockOutOrder')->getFindField(array("id" => $stock_out_id), "warehousing_status");
if ($warehousing_status == 1) {
$res['status'] = 0;
$res['msg'] = '已入库,请勿重复操作';
} else {
$res['status'] = 1;
$res['msg'] = '验证成功';
}
return $res;
}
}