init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Common\Model;
|
||||
|
||||
use Think\Model;
|
||||
|
||||
//[1.7.90]
|
||||
|
||||
/**
|
||||
*门店盘点串号记录
|
||||
* Class PurchaseGoodsModel
|
||||
* @package Common\Model
|
||||
*/
|
||||
class SellSerialModel extends BaseModel
|
||||
{
|
||||
protected $tableName = 'retail_sell_serial';
|
||||
protected $fields = array(
|
||||
'id', //int(11) NOT NULL AUTO_INCREMENT,
|
||||
'merchant_id', //int(11) DEFAULT '0' COMMENT '商户Id',
|
||||
'store_id',
|
||||
'outside_id', //外部明细id
|
||||
'goods_id', //商品id
|
||||
'sku_id', //规格id
|
||||
'main_serial_number', //主串码
|
||||
'auxiliary_serial_number_one', //辅助串码1
|
||||
'auxiliary_serial_number_two', //辅助串码2
|
||||
'add_time', //添加时间
|
||||
'num', //数量
|
||||
'type', //1出库 2入库
|
||||
'edit_type'
|
||||
);
|
||||
|
||||
/**
|
||||
* 串号搜索订单id
|
||||
* @param $serial_number 串号
|
||||
* @param int $type 1出库 2入库
|
||||
* @return mixed
|
||||
*/
|
||||
public function basisSerialOrderId($serial_number, $type = 1)
|
||||
{
|
||||
$order_id_arr = $this->alias('a')
|
||||
->join('ls_retail_sell as s on a.outside_id = s.id')
|
||||
->where([
|
||||
'a.num' => ['gt', 0],
|
||||
'a.main_serial_number|a.auxiliary_serial_number_one|a.auxiliary_serial_number_two' => ['like','%'.$serial_number.'%'],
|
||||
'a.type' => is_array($type) ? ['in', $type] : $type
|
||||
])->field('s.bill_id')
|
||||
->select();
|
||||
return array_columns($order_id_arr,'bill_id');
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户