Commit 26f15586 by lzzzzl

initial commit

parent ea893f4f
...@@ -17,11 +17,11 @@ LARAVELS_LISTEN_PORT=40001 ...@@ -17,11 +17,11 @@ LARAVELS_LISTEN_PORT=40001
worker_num = 3 worker_num = 3
DB_CONNECTION=mysql DB_CONNECTION=mysql
DB_HOST=192.168.1.235 DB_HOST=192.168.2.232
DB_USERNAME=icDb29mLy2s DB_USERNAME=liexin_scm_wms
DB_PASSWORD=icDb29mLy2s DB_PASSWORD=liexin_scm_wms#zsyM
DB_DATABASE=liexin_scm_wms
DB_PORT=3306 DB_PORT=3306
DB_DATABASE=0
REDIS_HOST=192.168.1.235 REDIS_HOST=192.168.1.235
REDIS_PASSWORD=icDb29mLy2s REDIS_PASSWORD=icDb29mLy2s
......
<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
use Config;
use DB;
use RedisDB;
use Request;
class CustomerModel extends Model
{
protected $connection = 'mysql';
protected $table = 'customer';
public $timestamps = false;
/**
* 客户信息
*/
public function CustomerInfo($arr) {
$limit = $arr['limit'];
$page = $arr['page'];
$customer_name = $arr['customer_name'];
$map = [];
if (!empty($customer_name)) {
$map[] = ['customer_name', '=', $customer_name];
}
$data = $this->
select('erp_client_sn','customer_name','erp_customer_id')->
where($map)->
paginate($limit,['*'],'p',$page)->
toArray();
return $data;
}
/**
* 写入客户信息
*/
public function insertCustomerInfo($arr) {
return $this->insert($arr);
}
/**
* 更新客户信息
*/
public function updateCustomerInfo($arr) {
return $this->where('customer_id', '=', $arr)->update($arr);
}
}
\ No newline at end of file
<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
use Config;
use DB;
use RedisDB;
use Request;
class GoodsModel extends Model
{
protected $connection = 'mysql';
protected $table = 'goods';
public $timestamps = false;
public function __construct($connection = false)
{
parent::__construct();
if($connection){
$this->connection= $connection;
}
}
/**
* 区域信息
*/
public function GoodsInfo($arr) {
$limit = $arr['limit'];
$page = $arr['page'];
$goods_name = $arr['goods_name'];
$map = [];
if (!empty($goods_name)) {
$map[] = ['goods_name', '=', $goods_name];
}
$data = $this->
select('goods_name','goods_cn_name','goods_sn','brand_name','erp_id')->
where($map)->
leftJoin('brand','brand.brand_id','goods.goods_id')->
paginate($limit,['*'],'p',$page)->
toArray();
return $data;
}
/**
* 写入DB物料
*/
public function InsertGoodsInfo($arr) {
$str = DB::connection($this->connection)->transaction(function() use($arr){
$brand_name = $arr['brand_name'];
$brand_exist = DB::connection('mysql')->table('brand')->where('brand_name','=',$brand_name)->first();
// $data = $this->where('rule_code', $ruleCode)->first();
var_dump($brand_exist);
});
}
}
\ No newline at end of file
<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
use Config;
use DB;
use RedisDB;
use Request;
class LocationModel extends Model
{
protected $connection = 'mysql';
protected $table = 'location';
public $timestamps = false;
/**
* 区域信息
*/
public function locInfo($arr) {
$limit = $arr['limit'];
$page = $arr['page'];
$location_name = $arr['location_name'];
$zone_name = $arr['zone_name'];
$map = [];
if (!empty($zone_name)) {
$map[] = ['zone_name', '=', $zone_name];
}
if (!empty($location_name)) {
$map[] = ['location_name', '=', $location_name];
}
$data = $this->
select('location_id','location_name','zone_name')->
where($map)->
leftJoin('zone','zone.zone_id','location.zone_id')->
paginate($limit,['*'],'p',$page)->
toArray();
return $data;
}
/**
* 写入货位信息
*/
public function insertLocationInfo($arr) {
return $this->insert($arr);
}
/**
* 更新货位信息
*/
public function updateLocationInfo($arr) {
return $this->where('location_id', '=', $arr)->update($arr);
}
}
\ No newline at end of file
<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
use Config;
use DB;
use RedisDB;
use Request;
class StoreModel extends Model
{
protected $connection = 'mysql';
protected $table = 'store';
public $timestamps = false;
/**
* 仓库基本信息
*/
public function storeInfo($arr) {
$limit = $arr['limit'];
$page = $arr['page'];
$store_sn = $arr['store_sn'];
$store_name = $arr['store_name'];
$erp_store_sn = $arr['erp_store_sn'];
$map = [];
if (!empty($store_sn)) {
$map[] = ['store_sn', '=', $store_sn];
}
if (!empty($store_name)) {
$map[] = ['store_name', '=', $store_name];
}
if (!empty($erp_store_sn)) {
$map[] = ['erp_store_sn', '=', $erp_store_sn];
}
$data = $this->
select('store_id','store_sn','store_name','erp_store_sn','erp_store_id')->
where($map)->
paginate($limit,['*'],'p',$page)->
toArray();
return $data;
}
/**
* 写入仓库信息
*/
public function insertStoreInfo($arr) {
return $this->insert($arr);
}
/**
* 更新仓库信息
*/
public function updateStoreInfo($arr) {
return $this->where('store_id', '=', $arr)->update($arr);
}
}
\ No newline at end of file
<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
use Config;
use DB;
use RedisDB;
use Request;
class SupplierModel extends Model
{
protected $connection = 'mysql';
protected $table = 'supplier';
public $timestamps = false;
/**
* 区域信息
*/
public function SupplierInfo($arr) {
$limit = $arr['limit'];
$page = $arr['page'];
$supplier_name = $arr['supplier_name'];
$map = [];
if (!empty($supplier_name)) {
$map[] = ['supplier_name', '=', $supplier_name];
}
$data = $this->
select('erp_supplier_sn','supplier_name','erp_supplier_id')->
where($map)->
paginate($limit,['*'],'p',$page)->
toArray();
return $data;
}
/**
* 写入供应商信息
*/
public function insertSupplierInfo($arr) {
return $this->insert($arr);
}
/**
* 更新供应商信息
*/
public function updateSupplierInfo($arr) {
return $this->where('supplier_id', '=', $arr)->update($arr);
}
}
\ No newline at end of file
<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
use Config;
use DB;
use RedisDB;
use Request;
class ZoneModel extends Model
{
protected $connection = 'mysql';
protected $table = 'zone';
public $timestamps = false;
/**
* 区域信息
*/
public function zoneInfo($arr) {
$limit = $arr['limit'];
$page = $arr['page'];
$zone_sn = $arr['zone_sn'];
$zone_name = $arr['zone_name'];
$store_name = $arr['store_name'];
$map = [];
if (!empty($zone_sn)) {
$map[] = ['zone_sn', '=', $zone_sn];
}
if (!empty($zone_name)) {
$map[] = ['zone_name', '=', $zone_name];
}
if (!empty($store_name)) {
$map[] = ['store_name', '=', $store_name];
}
$data = $this->
select('zone_id','zone_sn','zone_name','store_name')->
where($map)->
leftJoin('store','zone.store_id','store.store_id')->
paginate($limit,['*'],'p',$page)->
toArray();
return $data;
}
/**
* 写入仓库信息
*/
public function insertZoneInfo($arr) {
return $this->insert($arr);
}
/**
* 更新仓库信息
*/
public function updateZoneInfo($arr) {
return $this->where('zone_id', '=', $arr)->update($arr);
}
}
\ No newline at end of file
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"App\\": "app/", "App\\": "app/",
"Common\\": "common/" "Common\\": "common/",
"ScmWmsCommon\\": "scm_wms_common/"
}, },
"files": [ "files": [
"common/function.php", "common/function.php",
......
...@@ -66,7 +66,7 @@ return [ ...@@ -66,7 +66,7 @@ return [
'password' => env('DB_PASSWORD', ''), 'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'), 'charset' => env('DB_CHARSET', 'utf8'),
'collation' => env('DB_COLLATION', 'utf8_unicode_ci'), 'collation' => env('DB_COLLATION', 'utf8_unicode_ci'),
'prefix' => env('DB_PREFIX', ''), 'prefix' => env('DB_PREFIX', 'lie_'),
'timezone' => env('DB_TIMEZONE', '+00:00'), 'timezone' => env('DB_TIMEZONE', '+00:00'),
'strict' => env('DB_STRICT_MODE', false), 'strict' => env('DB_STRICT_MODE', false),
'options' => [ 'options' => [
......
...@@ -4,6 +4,10 @@ return [ ...@@ -4,6 +4,10 @@ return [
'cn'=>[ 'cn'=>[
-1 => '系统错误', -1 => '系统错误',
0 => 'ok', 0 => 'ok',
101100 => 'ok',
101101 => '参数缺失',
101102 => '插入失败',
101103 => '更新失败'
] ]
......
<?php <?php
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Create The Application | Create The Application
......
...@@ -11,12 +11,18 @@ ...@@ -11,12 +11,18 @@
| |
*/ */
$router->get('/', function () use ($router) { // $router->get('/', function () use ($router) {
return swoole_get_local_ip(); // return swoole_get_local_ip();
return $router->app->version(); // return $router->app->version();
}); // });
$router->get('/basic/api/{key}', 'ServicesController@Entrance');
$router->post('/basic/api/{key}', 'ServicesController@Entrance');
$router->post('/synchronization', 'ServicesController@synchronization');
scm_wms_common @ 64218b25
Subproject commit 25169685f684fd4292671d1893a79e80c5be9db2 Subproject commit 64218b258abb792578ff19cc0270d218625a734a
...@@ -279,7 +279,7 @@ class ClassLoader ...@@ -279,7 +279,7 @@ class ClassLoader
*/ */
public function setApcuPrefix($apcuPrefix) public function setApcuPrefix($apcuPrefix)
{ {
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
} }
/** /**
...@@ -377,7 +377,7 @@ class ClassLoader ...@@ -377,7 +377,7 @@ class ClassLoader
$subPath = $class; $subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) { while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos); $subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\'; $search = $subPath.'\\';
if (isset($this->prefixDirsPsr4[$search])) { if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) { foreach ($this->prefixDirsPsr4[$search] as $dir) {
......
...@@ -20,6 +20,7 @@ return array( ...@@ -20,6 +20,7 @@ return array(
'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'), 'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'),
'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
'ScmWmsCommon\\' => array($baseDir . '/scm_wms_common'),
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
......
...@@ -42,6 +42,7 @@ class ComposerStaticInit5c9707cde9ea4e3942300fe24293f04f ...@@ -42,6 +42,7 @@ class ComposerStaticInit5c9707cde9ea4e3942300fe24293f04f
'Symfony\\Component\\EventDispatcher\\' => 34, 'Symfony\\Component\\EventDispatcher\\' => 34,
'Symfony\\Component\\Debug\\' => 24, 'Symfony\\Component\\Debug\\' => 24,
'Symfony\\Component\\Console\\' => 26, 'Symfony\\Component\\Console\\' => 26,
'ScmWmsCommon\\' => 13,
), ),
'P' => 'P' =>
array ( array (
...@@ -170,6 +171,10 @@ class ComposerStaticInit5c9707cde9ea4e3942300fe24293f04f ...@@ -170,6 +171,10 @@ class ComposerStaticInit5c9707cde9ea4e3942300fe24293f04f
array ( array (
0 => __DIR__ . '/..' . '/symfony/console', 0 => __DIR__ . '/..' . '/symfony/console',
), ),
'ScmWmsCommon\\' =>
array (
0 => __DIR__ . '/../..' . '/scm_wms_common',
),
'Psr\\SimpleCache\\' => 'Psr\\SimpleCache\\' =>
array ( array (
0 => __DIR__ . '/..' . '/psr/simple-cache/src', 0 => __DIR__ . '/..' . '/psr/simple-cache/src',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment