Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xxmp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chan
xxmp
Commits
ad979a8a
Commit
ad979a8a
authored
Apr 28, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改问题
parent
64cd7dbd
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
12 deletions
+133
-12
companyedit.inc.php
addons/longbing_company/inc/web/manage/companyedit.inc.php
+6
-1
shopendorder.inc.php
addons/longbing_company/inc/web/manage/shopendorder.inc.php
+99
-0
shopplaceorder.inc.php
addons/longbing_company/inc/wxapp/shopplaceorder.inc.php
+11
-5
shopplaceorder2.inc.php
addons/longbing_company/inc/wxapp/shopplaceorder2.inc.php
+12
-4
orders.html
addons/longbing_company/template/manage/orders.html
+2
-2
wxapp.php
addons/longbing_company/wxapp.php
+3
-0
No files found.
addons/longbing_company/inc/web/manage/companyedit.inc.php
View file @
ad979a8a
...
@@ -18,7 +18,12 @@ if ($id) {
...
@@ -18,7 +18,12 @@ if ($id) {
$company
[
'culture'
]
=
explode
(
','
,
$company
[
'culture'
]);
$company
[
'culture'
]
=
explode
(
','
,
$company
[
'culture'
]);
}
}
if
(
$_GPC
[
'action'
]
==
'region'
){
$parent_id
=
isset
(
$_GPC
[
"parent_id"
])
?
$_GPC
[
"parent_id"
]
:
1
;
$sql
=
"select * from "
.
tablename
(
'sys_region'
)
.
" where parent_id ="
.
$parent_id
;
$list
=
pdo_fetchall
(
$sql
);
exit
(
json_encode
(
array
(
'errno'
=>
0
,
'message'
=>
''
,
'data'
=>
$list
)));
}
load
()
->
func
(
'tpl'
);
load
()
->
func
(
'tpl'
);
include
$this
->
template
(
'manage/companyEdit'
);
include
$this
->
template
(
'manage/companyEdit'
);
...
...
addons/longbing_company/inc/web/manage/shopendorder.inc.php
0 → 100644
View file @
ad979a8a
<?php
//dezend by http://www.yunlu99.com/
function
changeWater
(
$id
)
{
$time
=
time
();
$list
=
pdo_getall
(
'longbing_company_selling_water'
,
array
(
'order_id'
=>
$id
,
'waiting'
=>
1
));
pdo_update
(
'longbing_company_selling_water'
,
array
(
'waiting'
=>
2
,
'update_time'
=>
$time
),
array
(
'order_id'
=>
$id
,
'waiting'
=>
1
));
foreach
(
$list
as
$index
=>
$item
)
{
$money
=
$item
[
'price'
]
*
$item
[
'extract'
]
/
100
;
$money
=
sprintf
(
'%.2f'
,
$money
);
$profit
=
pdo_get
(
'longbing_company_selling_profit'
,
array
(
'user_id'
=>
$item
[
'user_id'
]));
if
(
$profit
)
{
if
(
$money
<=
$profit
[
'waiting'
])
{
$waiting
=
$profit
[
'waiting'
]
-
$money
;
$total_profit
=
$profit
[
'total_profit'
]
+
$money
;
$profit_money
=
$profit
[
'profit'
]
+
$money
;
$waiting
=
sprintf
(
'%.2f'
,
$waiting
);
$total_profit
=
sprintf
(
'%.2f'
,
$total_profit
);
$profit_money
=
sprintf
(
'%.2f'
,
$profit_money
);
}
else
{
$waiting
=
0
;
$money
=
$profit
[
'waiting'
];
$total_profit
=
$profit
[
'total_profit'
]
+
$profit
[
'waiting'
];
$profit_money
=
$profit
[
'profit'
]
+
$profit
[
'waiting'
];
$total_profit
=
sprintf
(
'%.2f'
,
$total_profit
);
$profit_money
=
sprintf
(
'%.2f'
,
$profit_money
);
}
pdo_update
(
'longbing_company_selling_profit'
,
array
(
'waiting'
=>
$waiting
,
'total_profit'
=>
$total_profit
,
'profit'
=>
$profit_money
),
array
(
'id'
=>
$profit
[
'id'
]));
$user
=
pdo_get
(
'longbing_company_user'
,
array
(
'id'
=>
$item
[
'source_id'
]));
if
(
$user
)
{
$create_money
=
$user
[
'create_money'
]
+
$money
;
$create_money
=
sprintf
(
'%.2f'
,
$create_money
);
pdo_update
(
'longbing_company_user'
,
array
(
'create_money'
=>
$create_money
,
'update_time'
=>
$time
),
array
(
'id'
=>
$user
[
'id'
]));
}
}
}
}
function
checkFreeCard
(
$order_id
){
$order_goods_list
=
pdo_getall
(
'longbing_company_shop_order_item'
,
array
(
'order_id'
=>
$order_id
));
$return
=
false
;
foreach
(
$order_goods_list
as
$order_goods
){
$goods
=
pdo_get
(
'longbing_company_goods'
,
array
(
'id'
=>
$order_goods
[
'goods_id'
]));
if
(
$goods
&&
$goods
[
'is_free_card'
]){
$return
=
true
;
break
;
}
}
return
$return
;
}
define
(
'ROOT_PATH'
,
IA_ROOT
.
'/addons/longbing_company/'
);
is_file
(
ROOT_PATH
.
'/inc/we7.php'
)
||
exit
(
'Access Denied Longbing'
);
require_once
ROOT_PATH
.
'/inc/we7.php'
;
global
$_GPC
;
global
$_W
;
$uid
=
$_GPC
[
'user_id'
];
$id
=
$_GPC
[
'id'
];
if
(
!
$uid
||
!
$id
)
{
return
$this
->
result
(
-
1
,
''
,
array
());
}
$where
=
array
(
'user_id'
=>
$uid
,
'id'
=>
$id
);
$info
=
pdo_get
(
'longbing_company_shop_order'
,
$where
);
if
(
!
$info
)
{
return
$this
->
result
(
-
1
,
''
,
array
());
}
if
(
$info
[
'order_status'
]
!=
2
)
{
return
$this
->
result
(
-
1
,
''
,
array
());
}
$uniacid
=
$info
[
'uniacid'
];
$result
=
pdo_update
(
'longbing_company_shop_order'
,
array
(
'order_status'
=>
3
),
$where
);
if
(
$info
[
'type'
]
==
1
)
{
$infos
=
pdo_getall
(
'longbing_company_shop_order'
,
array
(
'collage_id'
=>
$info
[
'collage_id'
],
'order_status >'
=>
2
));
$collage
=
pdo_get
(
'longbing_company_shop_collage_list'
,
array
(
'id'
=>
$info
[
'collage_id'
]));
if
(
$collage
[
'number'
]
&&
$collage
[
'number'
]
==
count
(
$infos
))
{
pdo_update
(
'longbing_company_shop_collage_list'
,
array
(
'collage_status'
=>
3
),
array
(
'id'
=>
$info
[
'collage_id'
]));
}
}
if
(
$result
)
{
changeWater
(
$id
);
/*if(checkFreeCard($id)){
pdo_update('longbing_company_user', array('is_pay' => 1,'is_staff'=>1), array('id' => $uid));
}*/
return
$this
->
result
(
0
,
''
,
array
());
}
return
$this
->
result
(
-
1
,
''
,
array
());
?>
addons/longbing_company/inc/wxapp/shopplaceorder.inc.php
View file @
ad979a8a
...
@@ -15,15 +15,17 @@ $record_id = $_GPC['record_id'];
...
@@ -15,15 +15,17 @@ $record_id = $_GPC['record_id'];
$direct
=
$_GPC
[
'direct'
];
$direct
=
$_GPC
[
'direct'
];
$number
=
$_GPC
[
'number'
];
$number
=
$_GPC
[
'number'
];
$trolley_arr
=
explode
(
','
,
$trolley_ids
);
$trolley_arr
=
explode
(
','
,
$trolley_ids
);
if
(
!
$address_id
||
empty
(
$trolley_arr
))
{
/*if (!$address_id || empty($trolley_arr)) {
return $this->result(-1, '', array());
}*/
if
(
!
$number
||
!
$goods_id
)
{
return
$this
->
result
(
-
1
,
''
,
array
());
return
$this
->
result
(
-
1
,
''
,
array
());
}
}
/*$address = pdo_get('longbing_company_shop_address', array('id' => $address_id, 'user_id' => $uid));
$address
=
pdo_get
(
'longbing_company_shop_address'
,
array
(
'id'
=>
$address_id
,
'user_id'
=>
$uid
));
if (empty($address)) {
if (empty($address)) {
return $this->result(-1, '', array());
return $this->result(-1, '', array());
}
}
*/
$trolley_in
=
'('
.
$trolley_ids
.
')'
;
$trolley_in
=
'('
.
$trolley_ids
.
')'
;
...
@@ -70,7 +72,11 @@ foreach ($list as $k => $v) {
...
@@ -70,7 +72,11 @@ foreach ($list as $k => $v) {
$total_freight
+=
$v
[
'freight'
];
$total_freight
+=
$v
[
'freight'
];
$price
+=
$spe_price
[
'price'
]
*
$v
[
'number'
];
$price
+=
$spe_price
[
'price'
]
*
$v
[
'number'
];
}
}
$user
=
pdo_get
(
'longbing_company_user'
,
array
(
'id'
=>
$to_uid
,
'is_staff'
=>
1
));
$user1
=
pdo_get
(
'longbing_company_user'
,
array
(
'id'
=>
$uid
,
'is_staff'
=>
1
));
if
(
!
$user
||
$user1
){
$to_uid
=
0
;
}
$time
=
time
();
$time
=
time
();
$total_freight
=
sprintf
(
'%.2f'
,
$total_freight
);
$total_freight
=
sprintf
(
'%.2f'
,
$total_freight
);
$price
=
sprintf
(
'%.2f'
,
$price
);
$price
=
sprintf
(
'%.2f'
,
$price
);
...
...
addons/longbing_company/inc/wxapp/shopplaceorder2.inc.php
View file @
ad979a8a
...
@@ -13,7 +13,10 @@ $record_id = $_GPC['record_id'];
...
@@ -13,7 +13,10 @@ $record_id = $_GPC['record_id'];
$number
=
$_GPC
[
'number'
];
$number
=
$_GPC
[
'number'
];
$goods_id
=
$_GPC
[
'goods_id'
];
$goods_id
=
$_GPC
[
'goods_id'
];
$spe_id
=
$_GPC
[
'spe_price_id'
];
$spe_id
=
$_GPC
[
'spe_price_id'
];
if
(
!
$address_id
||
!
$number
||
!
$goods_id
)
{
/*if (!$address_id || !$number || !$goods_id) {
return $this->result(-1, '', array());
}*/
if
(
!
$number
||
!
$goods_id
)
{
return
$this
->
result
(
-
1
,
''
,
array
());
return
$this
->
result
(
-
1
,
''
,
array
());
}
}
...
@@ -42,16 +45,21 @@ foreach ($speList as $k2 => $v2) {
...
@@ -42,16 +45,21 @@ foreach ($speList as $k2 => $v2) {
}
}
$titles
=
trim
(
$titles
,
'-'
);
$titles
=
trim
(
$titles
,
'-'
);
$address
=
pdo_get
(
'longbing_company_shop_address'
,
array
(
'id'
=>
$address_id
,
'user_id'
=>
$uid
));
/*
$address = pdo_get('longbing_company_shop_address', array('id' => $address_id, 'user_id' => $uid));
if (empty($address)) {
if (empty($address)) {
return $this->result(-1, '', array());
return $this->result(-1, '', array());
}
}
*/
$user
=
pdo_get
(
'longbing_company_user'
,
array
(
'id'
=>
$to_uid
,
'is_staff'
=>
1
));
$user1
=
pdo_get
(
'longbing_company_user'
,
array
(
'id'
=>
$uid
,
'is_staff'
=>
1
));
if
(
!
$user
||
$user1
){
$to_uid
=
0
;
}
$time
=
time
();
$time
=
time
();
$total_freight
=
sprintf
(
'%.2f'
,
$goods_info
[
'freight'
]);
$total_freight
=
sprintf
(
'%.2f'
,
$goods_info
[
'freight'
]);
$price
=
sprintf
(
'%.2f'
,
$spe_info
[
'price'
]
*
$number
);
$price
=
sprintf
(
'%.2f'
,
$spe_info
[
'price'
]
*
$number
);
$insertOrder
=
array
(
'user_id'
=>
$uid
,
'address_id'
=>
$address_id
,
'freight'
=>
$total_freight
,
'price'
=>
$price
,
'total_price'
=>
$total_freight
+
$price
,
'uniacid'
=>
$uniacid
,
'name'
=>
$address
[
'name'
],
'sex'
=>
$address
[
'sex'
],
'phone'
=>
$address
[
'phone'
],
'address'
=>
$address
[
'address'
],
'address_detail'
=>
$address
[
'address_detail'
],
'province'
=>
$address
[
'province'
],
'city'
=>
$address
[
'city'
],
'area'
=>
$address
[
'area'
],
'to_uid'
=>
$to_uid
,
'create_time'
=>
$time
,
'update_time'
=>
$time
);
$insertOrder
=
array
(
'user_id'
=>
$uid
,
'address_id'
=>
0
,
'freight'
=>
$total_freight
,
'price'
=>
$price
,
'total_price'
=>
$total_freight
+
$price
,
'uniacid'
=>
$uniacid
,
'name'
=>
$address
[
'name'
],
'sex'
=>
$address
[
'sex'
],
'phone'
=>
$address
[
'phone'
],
'address'
=>
$address
[
'address'
],
'address_detail'
=>
$address
[
'address_detail'
],
'province'
=>
$address
[
'province'
],
'city'
=>
$address
[
'city'
],
'area'
=>
$address
[
'area'
],
'to_uid'
=>
$to_uid
,
'create_time'
=>
$time
,
'update_time'
=>
$time
);
if
(
$record_id
)
{
if
(
$record_id
)
{
$sign
=
true
;
$sign
=
true
;
...
...
addons/longbing_company/template/manage/orders.html
View file @
ad979a8a
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
{elseif $item['pay_status'] == 1}
{elseif $item['pay_status'] == 1}
{if $item['order_status'] == 0}
{if $item['order_status'] == 0}
<span
class=
"layui-badge layui-bg-orange"
>
未
发货
</span>
<span
class=
"layui-badge layui-bg-orange"
>
未
审核
</span>
{elseif $item['order_status'] == 2}
{elseif $item['order_status'] == 2}
<span
class=
"layui-badge layui-bg-green"
>
已发货
</span>
<span
class=
"layui-badge layui-bg-green"
>
已发货
</span>
{elseif $item['order_status'] == 3}
{elseif $item['order_status'] == 3}
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
{if $item['collage_check'] == 1}
{if $item['collage_check'] == 1}
<button
type=
"button"
class=
"layui-btn layui-btn-xs btn-send-item"
<button
type=
"button"
class=
"layui-btn layui-btn-xs btn-send-item"
itemId=
"{$item['id']}"
>
itemId=
"{$item['id']}"
>
发货
审核
</button>
</button>
{/if}
{/if}
{/if}
{/if}
...
...
addons/longbing_company/wxapp.php
View file @
ad979a8a
...
@@ -9812,6 +9812,9 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
...
@@ -9812,6 +9812,9 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
}
}
if
(
$staff
)
{
if
(
$staff
)
{
if
(
$staff
[
'is_stock'
]
==
1
&&
$config
[
'stock_extract'
]
&&
$config
[
'stock_extract'
]
>
0
&&
$config
[
'stock_extract'
]
<
100
){
$config
[
'staff_extract'
]
=
$config
[
'stock_extract'
];
}
$extract_money
=
$price
*
$config
[
'staff_extract'
]
/
100
;
$extract_money
=
$price
*
$config
[
'staff_extract'
]
/
100
;
$extract_money
=
sprintf
(
'%.2f'
,
$extract_money
);
$extract_money
=
sprintf
(
'%.2f'
,
$extract_money
);
@
pdo_update
(
'longbing_company_selling_profit'
,
array
(
'waiting +='
=>
$extract_money
),
array
(
'user_id'
=>
$staff_id
));
@
pdo_update
(
'longbing_company_selling_profit'
,
array
(
'waiting +='
=>
$extract_money
),
array
(
'user_id'
=>
$staff_id
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment