getSelect($where,$page,$limit); if($orderList){ foreach ($orderList as $key=>&$val){ $val['index'] = $key + 1; $val['store_name'] = D('Store')->getStoreName(array('id'=>$val['store_id'])); $val['transfer_name'] = D('Store')->getStoreName(array('id'=>$val['transfer_to_store_id'])); $val['money_total'] = round($val['money_total'],2); $val['add_time'] = date('Y-m-d H:i:s',$val['add_time']); $val['warehouse_time'] = date('Y-m-d H:i:s',$val['warehouse_time']); switch ($val['examine_status']){ case 0: $val['examine_name'] = '未审核'; break; case 1: if(!$val['warehousing_status']){ $val['examine_name'] = '未入库'; }else{ $val['examine_name'] = '已入库'; $val['real_money_total'] = round($val['real_money_total'],2); } break; case 2: $val['examine_name'] = '拒绝'; break; } } } $res['status'] = 1; $res['msg'] = '查询成功'; $res['data'] = $orderList; $this->ajaxReturn($res); } /*门店间调拨审核操作 *@param $id 出库单id *@param $type 门店调拨出库商户审核 0未审核 1审核通过 2审核失败 */ public function ExamineAction() { $id = I("post.id"); $type = I("post.type"); $parameter = array( 'id'=>$id, 'type'=>$type ); $res = A("Api/Inventory")->MerExamine($parameter); if($res['status'] == 1){ $log_data = array( 'source'=>1, 'type'=>3, 'request_data'=>json_encode($_POST), 'operator_id'=>$_POST['operator_id'], 'mer_id'=>$_POST['merchantid'] ); if($type == 1){ $log_data['desc']='门店间调拨审核-同意'; }else{ $log_data['desc']='门店间调拨审核-拒绝'; } action_log_v2($log_data); } $this->ajaxReturn($res); } /*调拨的出库详情 *@param $id 出库单id */ public function AllocationDetails() { $where['stock_out_id'] = I("post.id"); $detailsList = D('SStockOutGoods')->getSelect($where,$page='',$limit=''); if($detailsList) { foreach ($detailsList as $key=>&$val){ $val['stock_num'] = round($val['stock_num'],3); $val['stock_price'] = round($val['stock_price'],2); $val['subtotal'] = round($val['subtotal'],2); $val['sku_num'] = round($val['sku_num'],3); if($val['attribute_state'] == 2){ $val['goods_code'] = $val['sku_code']; $val['goods_number'] = $val['sku_goods_number']; } } } $res['data'] = $detailsList; $res['status'] = 1; $this->ajaxReturn($res); } /*调拨的入库详情 *@param $id 入库单id */ public function WarehousingDetails() { $where['warehouse_record_id'] = I("post.warehouse_record_id");; $detailsList = D('SWarehousingGoods')->getSelect($where,$page='',$limit=''); if($detailsList) { foreach ($detailsList as $key=>&$val){ $val['warehouse_num'] = round($val['warehouse_num'],3); $val['warehouse_price'] = round($val['warehouse_price'],2); $val['subtotal'] = round($val['subtotal'],2); $val['sku_num'] = round($val['sku_num'],3); if($val['attribute_state'] == 2){ $val['goods_code'] = $val['sku_code']; $val['goods_number'] = $val['sku_goods_number']; } } } $res['data'] = $detailsList; $res['status'] = 1; $this->ajaxReturn($res); } }