35 lines
1.7 KiB
PHP
35 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace app\index\library\qimen;
|
|
|
|
use Exception;
|
|
use think\Db;
|
|
use think\db\exception\BindParamException;
|
|
use think\db\exception\DataNotFoundException;
|
|
use think\db\exception\ModelNotFoundException;
|
|
use think\exception\DbException;
|
|
use think\exception\PDOException;
|
|
use think\exception\ValidateException;
|
|
|
|
class Main
|
|
{
|
|
protected $StockModel;
|
|
protected $StockBarcodesModel;
|
|
protected $StockQimenModel;
|
|
|
|
public function _initialize(){
|
|
$this->redis = new \Redis();
|
|
$this->redis->connect('127.0.0.1', 6379);
|
|
$this->redis->auth('qwe2019@');
|
|
$this->redis->select(4);
|
|
$this->StockQimenModel = new \app\common\model\wms_new\StockQimen;
|
|
$this->StockBarcodesModel = new \app\common\model\wms_new\StockBarcodes;
|
|
$this->ApiAppModel = new \app\common\model\wms_new\ApiApp;
|
|
$this->EntryOrderModel = new \app\common\model\wms_new\EntryOrder;
|
|
$this->EntryItems = new \app\common\model\wms_new\EntryItems;
|
|
}
|
|
public function getContract($appKey,$ownerCode,$warehouseCode){
|
|
$api = $this->ApiAppModel->alias('api')->field('api.contract_id as contractId,store.id as storeId,warehouse.id as warehouseId,warehouse.store_name as warehouse_name,store.store_name as store_name,store_warehouse.store_remask as storRemask,store_warehouse.warehouse_remask as warehouseRemask')->join("wms_store_warehouse store_warehouse","store_warehouse.id=api.contract_id","left")->join("wms_store store","store.id=store_warehouse.store_id","left")->join("wms_store warehouse","warehouse.id=store_warehouse.warehouse_id","left")->where(["api.qimen_app_key"=>$appKey,"api.qimen_customer_id"=>$ownerCode,"api.qimen_warehouse_code"=>$warehouseCode,"api.is_enabled"=>1])->find();
|
|
return $api;
|
|
}
|
|
} |