4) { $orderid = substr($orderid, -4, 4); } $l = substr(time(), 0, 4); $str = $left . $l . $orderid; return $str; } /* * 商品分类 */ private function goodsClass($merchant_id) { $class_name = M('retail_goods_class')->where(array('merchantid' => $merchant_id, 'status' => 0, 'type' => 1))->order('code asc')->select(); $this->assign('goodsClass1', json_encode($class_name)); } /* * 查询仓库 */ private function Info($merchant_id, $store_id) { $where['merchant_id'] = $merchant_id; $where['store_id'] = $store_id; $where['status'] = 1; $supplier = D('SSupplier')->getSelect($where, $page = '', $limit = '', "id,supplier_name"); $map['merchant_id'] = $merchant_id; $map['store_id'] = $store_id; $map['status'] = 1; $fields = "id,name"; $warehouse = D('SSaleWarehouse')->getSelect($map, $page = '', $limit = '', $fields); $this->assign('warehouse', json_encode($warehouse)); $this->assign('supplier', json_encode($supplier)); } public function index() { $arr = array( 'exportOperation' => '/index.php/Retail/SSaleMGoods/export', 'replenishment' => '/index.php/Retail/SSaleMGoods/replenishment', 'warehousing_record' => '/index.php/Retail/SSaleMGoods/warehousing_record', 'deposit_record' => '/index.php/Retail/SSaleMGoods/deposit_record' ); $stock_status = I("get.stock_status"); $stock_status = $stock_status ? $stock_status : ""; $this->assign('stock_status', $stock_status); $authArr = checkFunction($arr); $this->assign('authArr', $authArr); $user = session("ls_userinfo"); $store_id = session("storeid"); $this->Info($user['merchantid'], $store_id); $this->goodsClass($user['merchantid']); $this->assign('showPrice', self::$showPrice); $this->assign("identity", self::$identity); $this->assign("global_store_jurisdiction", self::$global_store_jurisdiction); try { $isTable = M()->query('SHOW TABLES LIKE "ls_retail_floworder"'); if ($isTable) { $jiuban = M('retail_floworder')->where(array('status' => 1, 'storeid' => $store_id))->find(); } } catch (Exception $e) { } if ($jiuban) { $this->assign('jiuban', 1); } else { try { $isTable = M()->query('SHOW TABLES LIKE "ls_retail_goods_pd_order"'); if ($isTable) { $jiuban = M("retail_goods_pd_order")->where(array('storeid' => $store_id))->find(); } } catch (Exception $e) { } if ($jiuban) { $this->assign('jiuban', 1); } else { $this->assign('jiuban', 0); } } $this->display(); } //串号列表 public function serialList() { $data = I('post.'); $data['user_type'] = 4; $data['merchant_id'] = $this->merchant_id; $data['store_id'] = $this->store_id; $SerialClass = new SerialNumberGoods(); $result = $SerialClass->warehouseSerialList($data); $this->ajaxReturn($result); } //库存状况 public function goodsList() { $data = I('post.'); $data['user_type'] = 4; $data['merchant_id'] = $this->merchant_id; $data['store_id'] = $this->store_id; $data['showPrice'] = self::$showPrice; $data['identity'] = self::$identity; $SaleClass = new SaleGoods(); $result = $SaleClass->warehouseGoods($data); $this->ajaxReturn($result); } public function export() { $user = session("ls_userinfo"); $store_id = session("storeid"); $merchant_id = $user['merchantid']; $content = I("get."); $warehouse_id = $content['warehouse_id']; $goods_number = $content['goods_number']; $status = $content['status']; $stock_status = $content['stock_status']; $person1 = $content['person1']; $person2 = $content['person2']; $person3 = $content['person3']; if (!empty($warehouse_id)) { $where['warehouse_id'] = $warehouse_id; } if (!empty($goods_number)) { $where['goods_number|sku_goods_number|goods_code|sku_code|goods_name|sku_name'] = array('like', $goods_number . "%"); } if (!empty($stock_status)) { switch ($stock_status) { case 1: $where['_string'] = "goods_num <= less_num"; break; case 2: $where['_string'] = "goods_num >= more_num"; break; case 3: $where['_string'] = "goods_num <= 0"; break; } } $flag = 0; if (!empty($person3)) { $where['goods_class_id'] = $person3; } else if (!empty($person2)) { $class = M('retail_goods_class as c2') ->join('ls_retail_goods_class as c3 on c2.id=c3.pid') ->where(array('c2.id' => $person2, 'c3.status' => 0)) ->field('c3.id')->select(); $flag = 1; } else if (!empty($person1)) { $class = M('retail_goods_class as c1') ->join('ls_retail_goods_class as c2 on c1.id=c2.pid') ->join('ls_retail_goods_class as c3 on c2.id=c3.pid AND c3.status=0', 'LEFT') ->where(array('c1.id' => $person1, 'c2.status' => 0)) ->field('c2.id,c3.id as c3_id')->select(); $flag = 1; } if (!empty($class)) { $arr = array(); foreach ($class as &$val) { if (!in_array($val['id'], $arr)) { $arr[] = $val['id']; } if (!empty($val['c3_id'])) { if (!in_array($val['c3_id'], $arr)) { $arr[] = $val['c3_id']; } } } $str = implode(',', $arr); $where['goods_class_id'] = array('in', $str . ',' . ($person2 ? $person2 : $person1)); } else if ($flag == 1) { $where['goods_class_id'] = $person2 ? $person2 : $person1; } $where['status'] = array('in', '0,1'); if ($status != '') { $where['status'] = $status; } $where['merchant_id'] = $merchant_id; $where['store_id'] = $store_id; $goodsList = D('SSaleMGoods')->getSelect($where); if ($goodsList) { foreach ($goodsList as $key => &$val) { $val['index'] = $key + 1; $val['more_num'] = round($val['more_num'], 3); $val['less_num'] = round($val['less_num'], 3); $val['goods_num'] = round($val['goods_num'], 3); if (self::$showPrice == 2 && self::$identity == 2) { $val['cost_price'] = "***"; } else { $val['cost_price'] = round($val['cost_price'], 2); } $val['warehouse_name'] = D('SSaleWarehouse')->getFindField(array('id' => $val['warehouse_id']), "name"); if ($val['attribute_state'] == 2) { $val['goods_number'] = $val['sku_goods_number']; $val['goods_code'] = $val['sku_code']; } $val['sku_num'] = round($val['sku_num'], 3); $val['warehouse_name'] = D('SSaleWarehouse')->getFindField(array('id' => $val['warehouse_id']), "name"); $map = array(); $map['merchant_id'] = $merchant_id; $map['store_id'] = $store_id; $map['goods_id'] = $val['goods_id']; $map['surplus_num'] = array('gt', 0); if ($val['attribute_state'] == 2) { $map['sku_id'] = $val['sku_id']; } $field = "surplus_num,purchase_price"; $purchaseGoodsList = D('SPurchaseGoods')->getSelect($map, $page = '', $limit = '', $field); $actual_num = 0; //采购库总数量 $amount_total = 0; //采购库总金额 if ($purchaseGoodsList) { foreach ($purchaseGoodsList as $ke => &$va) { $actual_num += $va['surplus_num']; $amount_total += ($va['surplus_num'] * $va['purchase_price']); } } $val['actual_num'] = round($val['goods_num'] + $actual_num, 3); if (self::$showPrice == 2 && self::$identity == 2) { $val['amount_total'] = "***"; } else { $val['amount_total'] = round(($val['cost_price'] * $val['goods_num']) + $amount_total, 2); } if ($val['goods_num'] <= $val['less_num']) { $val['warning_name'] = "缺货"; } else if ($val['goods_num'] >= $val['more_num']) { $val['warning_name'] = "超量"; } else { $val['warning_name'] = "正常"; } switch ($val['status']) { case 0: $val['status_name'] = "上架"; break; case 1: $val['status_name'] = "下架"; break; } } } $fileds_name = "商品库存状况导出"; $arr = array( array('index', '序号'), array('goods_name', '名称'), array('sku_name', '规格'), array('goods_number', '货号'), array('goods_code', '条码'), array('company', '单位'), array('sku_num', '规格基数'), array('goods_num', '供应库存'), array('actual_num', '实际库存'), array('more_num', '库存上限'), array('less_num', '库存下限'), array('cost_price', '成本价'), array('amount_total', '库存金额'), array('warning_name', '库存状态'), array('status_name', '上下架状态'), ); $str = $fileds_name . ',导出日期:' . date('Y-m-d H:i:s', time()); getExcel($fileds_name, $arr, $goodsList, $str); } //详情导出 public function warehousingExport() { $user = session("ls_userinfo"); $store_id = session("storeid"); $goods_id = I('get.goods_id'); $attribute_state = I('get.attribute_state'); $sku_id = I('get.sku_id'); $order_number = I("get.order_number"); $add_time = I("get.add_time"); if (!empty($order_number)) { $where['warehouse_order_number'] = $order_number; } if (!empty($add_time)) { $add_time = explode(",", $add_time); $start_time = strtotime($add_time[0] . "00:00:00"); $end_time = strtotime($add_time[1] . "23:59:59"); $where['add_time'] = array('between', array($start_time, $end_time)); } $where['goods_id'] = $goods_id; $where['merchant_id'] = $user['merchantid']; $where['store_id'] = $store_id; if ($attribute_state == 2) { $where['sku_id'] = $sku_id; } $list = D('SWarehousingGoods')->getSelect($where); if ($list) { foreach ($list as $key => &$val) { $val['index'] = $key + 1; if (!empty($val['build_date'])) { $val['build_date'] = date('Y-m-d', $val['build_date']); } $val['sku_num'] = round($val['sku_num'], 3); $val['warehouse_num'] = round($val['warehouse_num'], 3); if (self::$showPrice == 2 && self::$identity == 2) { $val['warehouse_price'] = '***'; $val['subtotal'] = '***'; } else { $val['warehouse_price'] = round($val['warehouse_price'], 2); $val['subtotal'] = round($val['subtotal'], 2); } $val['add_time'] = date('Y-m-d H:i:s', $val['add_time']); switch ($val['type']) { case 0: $val['type_name'] = "其他入库"; break; case 1: $val['type_name'] = "采购入库"; break; case 2: $val['type_name'] = "补货入库"; break; case 3: $val['type_name'] = "盘盈入库"; break; case 4: $val['type_name'] = "商户调拨入库"; break; case 5: $val['type_name'] = "门店调拨入库"; break; case 6: $val['type_name'] = "申请调拨入库"; break; case 7: $val['type_name'] = "初始化入库"; break; case 8: $val['type_name'] = "拼团退货入库"; break; case 9: $val['type_name'] = "秒杀退货入库"; break; case 10: $val['type_name'] = "拆分入库"; break; case 11: $val['type_name'] = "收银退货入库"; $val['refund_price'] = round($val['refund_price'], 2); break; case 12: $val['type_name'] = "商城退货入库"; $val['refund_price'] = round($val['refund_price'], 2); break; case 13: $val['type_name'] = "组合入库"; break; } if ($val['attribute_state'] == 2) { $val['goods_number'] = $val['sku_goods_number']; $val['goods_code'] = $val['sku_code']; } } } else { $list = array(); } $fileds_name = "商品入库记录导出"; $arr = array( array('index', '序号'), array('warehouse_order_number', '入库单号'), array('type_name', '入库类型'), array('add_time', '入库时间'), array('goods_name', '商品名称'), array('sku_name', '规格'), array('goods_number', '货号'), array('goods_code', '条码'), array('sku_num', '规格基数'), array('company', '单位'), array('build_date', '生产日期'), array('quality_guarantee_period', '保质期'), array('warehouse_num', '数量'), array('warehouse_price', '入库价'), array('refund_price', '退货价'), array('subtotal', '小计'), array('remarks', '备注'), ); $str = $fileds_name . ',导出日期:' . date('Y-m-d H:i:s', time()); getExcel($fileds_name, $arr, $list, $str); } /* * *****************************************************成本价********************************** */ public function cost_price_record() { $goods_id = I('get.goods_id'); $attribute_state = I('get.attribute_state'); $sku_id = I('get.sku_id'); $this->assign('goods_id', $goods_id); $this->assign('attribute_state', $attribute_state); $this->assign('sku_id', $sku_id); $this->display(); } //成本价 public function trend_info() { $user = session("ls_userinfo"); $store_id = session("storeid"); $goods_id = I('post.goods_id'); $attribute_state = I('post.attribute_state'); $sku_id = I('post.sku_id'); $add_time = I("post.date"); if (!empty($add_time)) { $start_time = strtotime($add_time[0] . "00:00:00"); $end_time = strtotime($add_time[1] . "23:59:59"); $where['add_time'] = array('between', array($start_time, $end_time)); } else { $limit = 7; } $where['merchant_id'] = $user['merchantid']; $where['store_id'] = $store_id; $where['goods_id'] = $goods_id; $where['type'] = ['in', '1,3']; if ($attribute_state == 2) { $where['sku_id'] = $sku_id; } $field = 'purchase_price,cost_price,add_time'; $order = 'id desc'; $list = D('SCostPriceRecord')->getSelect($where, $limit, $field, $order); $where['type'] = 2; $retreatList = D('SCostPriceRecord')->getSelect($where, $limit, $field, $order); if ($list) { $cost_price = array_column($list, 'cost_price'); $purchase_price = array_column($list, 'purchase_price'); $time = array_column($list, 'add_time'); foreach ($cost_price as &$val) { $val = floatval($val); } foreach ($purchase_price as &$val) { $val = floatval($val); } foreach ($time as &$val) { $val = date('Y-m-d', $val); } } if ($retreatList) { $retreat_cost_price = array_column($retreatList, 'cost_price'); $retreat_price = array_column($retreatList, 'purchase_price'); $r_time = array_column($retreatList, 'add_time'); foreach ($retreat_cost_price as &$val) { $val = floatval($val); } foreach ($retreat_price as &$val) { $val = floatval($val); } foreach ($r_time as &$val) { $val = date('Y-m-d', $val); } } $cost_price = $cost_price ? array_reverse($cost_price) : array(); $purchase_price = $purchase_price ? array_reverse($purchase_price) : array(); $time = $time ? array_reverse($time) : array(); $retreat_cost_price = $retreat_cost_price ? array_reverse($retreat_cost_price) : array(); $retreat_price = $retreat_price ? array_reverse($retreat_price) : array(); $r_time = $r_time ? array_reverse($r_time) : array(); if (empty($list) && empty($retreatList)) { $res['status'] = 0; } else { $res['status'] = 1; $res['cost_price'] = $cost_price; $res['purchase_price'] = $purchase_price; $res['time'] = $time; $res['retreat_cost_price'] = $retreat_cost_price; $res['retreat_price'] = $retreat_price; $res['r_time'] = $r_time; } $this->ajaxReturn($res); } /* * ***************************************************记录*********************************************** */ public function warehousing_record() { $arr = array( 'exportOperation' => '/index.php/Retail/SSaleMGoods/warehousingExport', ); $authArr = checkFunction($arr); $this->assign('authArr', $authArr); $goods_id = I('get.goods_id'); $attribute_state = I('get.attribute_state'); $sku_id = I('get.sku_id'); $this->assign('goods_id', $goods_id); $this->assign('attribute_state', $attribute_state); $this->assign('sku_id', $sku_id); $this->assign('showPrice', self::$showPrice); $this->assign("identity", self::$identity); $this->assign("global_store_jurisdiction", self::$global_store_jurisdiction); $this->display(); } //入库记录串号列表 public function warehouseSerialList() { $data = I('post.'); $data['user_type'] = 4; $data['serial_type'] = 2; $SerialClass = new SerialNumberGoods(); $result = $SerialClass->recordSerialList($data); $this->ajaxReturn($result); } //入库记录 public function WarehousingRecordList() { $user = session("ls_userinfo"); $store_id = session("storeid"); $goods_id = I("post.goods_id"); $attribute_state = I("post.attribute_state"); $sku_id = I("post.sku_id"); $order_number = I("post.order_number"); $add_time = I("post.add_time"); if (!empty($order_number)) { $where['warehouse_order_number'] = $order_number; } if (!empty($add_time)) { $start_time = strtotime($add_time[0] . "00:00:00"); $end_time = strtotime($add_time[1] . "23:59:59"); $where['add_time'] = array('between', array($start_time, $end_time)); } $where['goods_id'] = $goods_id; $where['merchant_id'] = $user['merchantid']; $where['store_id'] = $store_id; if ($attribute_state == 2) { $where['sku_id'] = $sku_id; } $page = I("post.page"); $limit = I("post.limit"); $list = D('SWarehousingGoods')->getSelect($where, $page, $limit, $field = "", $order = ''); if ($list) { $count = D('SWarehousingGoods')->getCount($where); foreach ($list as $key => &$val) { $val['index'] = $key + 1; if (!empty($val['build_date'])) { $val['build_date'] = date('Y-m-d', $val['build_date']); } $val['sku_num'] = round($val['sku_num'], 3); $val['warehouse_num'] = round($val['warehouse_num'], 3); $val['warehouse_price'] = round($val['warehouse_price'], 2); $val['subtotal'] = round($val['subtotal'], 2); $val['add_time'] = date('Y-m-d H:i:s', $val['add_time']); switch ($val['type']) { case 0: $val['type_name'] = "其他入库"; break; case 1: $val['type_name'] = "采购入库"; break; case 2: $val['type_name'] = "补货入库"; break; case 3: $val['type_name'] = "盘盈入库"; break; case 4: $val['type_name'] = "商户调拨入库"; break; case 5: $val['type_name'] = "门店调拨入库"; break; case 6: $val['type_name'] = "申请调拨入库"; break; case 7: $val['type_name'] = "初始化入库"; break; case 8: $val['type_name'] = "拼团退货入库"; break; case 9: $val['type_name'] = "秒杀退货入库"; break; case 10: $val['type_name'] = "拆分入库"; break; case 11: $val['type_name'] = "收银退货入库"; $val['refund_price'] = round($val['refund_price'], 2); break; case 12: $val['type_name'] = "商城退货入库"; $val['refund_price'] = round($val['refund_price'], 2); break; case 13: $val['type_name'] = "组合入库"; break; case 21: $val['type_name'] = "门店调拨拒收入库"; break; } } } else { $list = array(); $count = 0; } $res['status'] = 1; $res['msg'] = ''; $res['count'] = $count; $res['data'] = $list; $this->ajaxReturn($res); } //出库记录串号列表 public function stockSerialList() { $data = I('post.'); $data['user_type'] = 4; $data['serial_type'] = 3; $SerialClass = new SerialNumberGoods(); $result = $SerialClass->recordSerialList($data); $this->ajaxReturn($result); } //出库记录 public function deposit_record() { $arr = array( 'exportOperation' => '/index.php/Retail/SSaleMGoods/depositExport', ); $authArr = checkFunction($arr); $this->assign('authArr', $authArr); $goods_id = I('get.goods_id'); $attribute_state = I('get.attribute_state'); $sku_id = I('get.sku_id'); $this->assign('goods_id', $goods_id); $this->assign('attribute_state', $attribute_state); $this->assign('sku_id', $sku_id); $this->assign('showPrice', self::$showPrice); $this->assign("identity", self::$identity); $this->assign("global_store_jurisdiction", self::$global_store_jurisdiction); $this->display(); } //出库记录 public function DepositRecordList() { $user = session("ls_userinfo"); $store_id = session("storeid"); $goods_id = I("post.goods_id"); $attribute_state = I("post.attribute_state"); $sku_id = I("post.sku_id"); $order_number = I("post.order_number"); $add_time = I("post.add_time"); if (!empty($order_number)) { $where['stock_order_number'] = $order_number; } if (!empty($add_time)) { $start_time = strtotime($add_time[0] . "00:00:00"); $end_time = strtotime($add_time[1] . "23:59:59"); $where['add_time'] = array('between', array($start_time, $end_time)); } $where['goods_id'] = $goods_id; $where['merchant_id'] = $user['merchantid']; $where['store_id'] = $store_id; if ($attribute_state == 2) { $where['sku_id'] = $sku_id; } $page = I("post.page"); $limit = I("post.limit"); $list = D('SStockOutGoods')->getSelect($where, $page, $limit, $field = "", $order = ''); if ($list) { $count = D('SStockOutGoods')->getCount($where); foreach ($list as $key => &$val) { $val['index'] = $key + 1; $val['sku_num'] = round($val['sku_num'], 3); $val['stock_num'] = round($val['stock_num'], 3); $val['stock_price'] = round($val['stock_price'], 2); $val['subtotal'] = round($val['subtotal'], 2); $val['add_time'] = date('Y-m-d H:i:s', $val['add_time']); switch ($val['type']) { case 0: $val['type_name'] = "其他出库"; break; case 1: $val['type_name'] = "退货至商户出库"; break; case 2: $val['type_name'] = "盘亏出库"; break; case 3: $val['type_name'] = "调拨出库"; break; case 4: $val['type_name'] = "拼团出库"; break; case 5: $val['type_name'] = "秒杀出库"; break; case 6: $val['type_name'] = "拆分出库"; break; case 7: $val['type_name'] = "收银出库"; $val['sale_price'] = round($val['sale_price'], 2); break; case 8: $val['type_name'] = "商城出库"; $val['sale_price'] = round($val['sale_price'], 2); break; case 9: $val['type_name'] = "退货至供货商出库"; break; case 10: $val['type_name'] = "组合出库"; break; } } } else { $list = array(); $count = 0; } $res['status'] = 1; $res['msg'] = ''; $res['count'] = $count; $res['data'] = $list; $this->ajaxReturn($res); } //出库导出 public function depositExport() { $user = session("ls_userinfo"); $store_id = session("storeid"); $goods_id = I("get.goods_id"); $attribute_state = I("get.attribute_state"); $sku_id = I("get.sku_id"); $order_number = I("get.order_number"); $add_time = I("get.add_time"); if (!empty($order_number)) { $where['stock_order_number'] = $order_number; } if (!empty($add_time)) { $add_time = explode(",", $add_time); $start_time = strtotime($add_time[0] . "00:00:00"); $end_time = strtotime($add_time[1] . "23:59:59"); $where['add_time'] = array('between', array($start_time, $end_time)); } $where['goods_id'] = $goods_id; $where['merchant_id'] = $user['merchantid']; $where['store_id'] = $store_id; if ($attribute_state == 2) { $where['sku_id'] = $sku_id; } $list = D('SStockOutGoods')->getSelect($where); if ($list) { foreach ($list as $key => &$val) { $val['index'] = $key + 1; $val['sku_num'] = round($val['sku_num'], 3); $val['stock_num'] = round($val['stock_num'], 3); if (self::$showPrice == 2 && self::$identity) { $val['stock_price'] = "***"; $val['subtotal'] = "***"; } else { $val['stock_price'] = round($val['stock_price'], 2); $val['subtotal'] = round($val['subtotal'], 2); } $val['add_time'] = date('Y-m-d H:i:s', $val['add_time']); switch ($val['type']) { case 0: $val['type_name'] = "其他出库"; break; case 1: $val['type_name'] = "退货至商户出库"; break; case 2: $val['type_name'] = "盘亏出库"; break; case 3: $val['type_name'] = "调拨出库"; break; case 4: $val['type_name'] = "拼团出库"; break; case 5: $val['type_name'] = "秒杀出库"; break; case 6: $val['type_name'] = "拆分出库"; break; case 7: $val['type_name'] = "收银出库"; $val['sale_price'] = round($val['sale_price'], 2); break; case 8: $val['type_name'] = "商城出库"; $val['sale_price'] = round($val['sale_price'], 2); break; case 9: $val['type_name'] = "退货至供货商出库"; break; case 10: $val['type_name'] = "组合出库"; break; } if ($val['attribute_state'] == 2) { $val['goods_number'] = $val['sku_goods_number']; $val['goods_code'] = $val['sku_code']; } } } $fileds_name = "出库记录导出"; $arr = array( array('index', '序号'), array('stock_order_number', '出库单号'), array('type_name', '出库类型'), array('add_time', '出库时间'), array('goods_name', '商品名称'), array('sku_name', '规格'), array('goods_number', '货号'), array('goods_code', '条码'), array('sku_num', '规格基数'), array('company', '单位'), array('stock_num', '数量'), array('stock_price', '出库价'), array('sale_price', '销售价'), array('subtotal', '小计'), array('remarks', '备注'), ); $str = $fileds_name . ',导出日期:' . date('Y-m-d H:i:s', time()); getExcel($fileds_name, $arr, $list, $str); } /* * ****************************************************补货********************************************** */ public function replenishment() { $arr = array( 'goodsChoice' => '/index.php/Retail/SSaleMGoods/purchaseList', 'onSubmit' => '/index.php/Retail/SSaleMGoods/repairOperation' ); $authArr = checkFunction($arr); $this->assign('authArr', $authArr); $user = session("ls_userinfo"); $store_id = session("storeid"); $goods_id = I('get.goods_id'); $attribute_state = I('get.attribute_state'); $sku_id = I('get.sku_id'); $this->Info($user['merchantid'], $store_id); $where['merchant_id'] = $user['merchantid']; $where['store_id'] = $store_id; $where['status'] = 1; $purchase_warehouse = D('SPurchaseWarehouse')->getSelect($where); $this->assign('goods_id', $goods_id); $this->assign('attribute_state', $attribute_state); $this->assign('sku_id', $sku_id); $this->assign('purchase_warehouse', json_encode($purchase_warehouse)); $this->assign('showPrice', self::$showPrice); $this->assign("identity", self::$identity); $this->display(); } //补货可入库的串码 public function purchaseSerialList() { $data = I('post.'); $data['user_type'] = 4; $SerialClass = new SerialNumberGoods(); $result = $SerialClass->returnableSerialList($data); $this->ajaxReturn($result); } //补货的商品列表 public function purchaseList() { $data = I('post.'); $data['user_type'] = 4; $data['merchant_id'] = $this->merchant_id; $data['store_id'] = $this->store_id; $PurchaseGoodsClass = new PurchaseGoodsInfo(); $result = $PurchaseGoodsClass->replenishGoodsList($data); $this->ajaxReturn($result); } //补货操作 public function repairOperation() { $data = I('post.'); $data['user_type'] = 4; $data['merchant_id'] = $this->merchant_id; $data['store_id'] = $this->store_id; $data['operator_id'] = session("jurisdiction_user")['id']; $data['type'] = 2; $data['stock'] = 1; $result = A("Api/Inventory")->Warehousing($data); $this->ajaxReturn($result); } }