|
@@ -6,6 +6,41 @@ use Dever;
|
|
|
|
|
|
class Main extends Core
|
|
|
{
|
|
|
+ # 登录
|
|
|
+ public function login()
|
|
|
+ {
|
|
|
+ $where['mobile'] = Dever::load('passport/reg')->checkMobileExists(false, -1, 'shop/member');
|
|
|
+
|
|
|
+ $user = Dever::db('shop/member')->select($where);
|
|
|
+
|
|
|
+ if ($user) {
|
|
|
+ $this->data['uid'] = $user['id'];
|
|
|
+ $this->data['signature'] = Dever::login($user['id']);
|
|
|
+ $this->data['user'] = $user;
|
|
|
+ $this->data['shop'] = array();
|
|
|
+ $this->data['shop_num'] = count($user);
|
|
|
+ $this->data['shop_id'] = false;
|
|
|
+ foreach ($user as $k => $v) {
|
|
|
+ $this->data['shop'][] = Dever::db('shop/info')->getOne($v['shop_id']);
|
|
|
+ $this->data['shop_id'] = $v['shop_id'];
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this->data;
|
|
|
+ } else {
|
|
|
+ Dever::alert('登录失败,手机号不存在');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ # 获取验证码
|
|
|
+ public function mcode()
|
|
|
+ {
|
|
|
+ $mobile = Dever::load('passport/reg')->checkMobileExists(1, -1, 'shop/member');
|
|
|
+
|
|
|
+ $msg = Dever::load('passport/reg')->getMcode_action($mobile);
|
|
|
+
|
|
|
+ return $msg;
|
|
|
+ }
|
|
|
+
|
|
|
# 申请合作
|
|
|
public function apply()
|
|
|
{
|
|
@@ -54,79 +89,4 @@ class Main extends Core
|
|
|
$this->data['msg'] = '提交成功,我们会在3个工作日内与您联系,感谢您的信任。';
|
|
|
return $this->data;
|
|
|
}
|
|
|
-
|
|
|
- public function home()
|
|
|
- {
|
|
|
- $day = Dever::input('day');
|
|
|
-
|
|
|
- if (!$day) {
|
|
|
- $day = date('Y-m-d');
|
|
|
- }
|
|
|
-
|
|
|
- $where['start'] = Dever::maketime($day . ' 00:00:00');
|
|
|
- $where['end'] = Dever::maketime($day . '59:59:59');
|
|
|
- $where['shop_id'] = $this->shop_id;
|
|
|
-
|
|
|
- $this->data['num_order'] = Dever::db('shop/sell_order')->getOrderNum($where);
|
|
|
- $this->data['num_cash'] = Dever::db('shop/sell_order')->getCashNum($where);
|
|
|
- $this->data['num_goods'] = Dever::db('shop/sell_order')->getGoodsNum($where);
|
|
|
-
|
|
|
- return $this->data;
|
|
|
- }
|
|
|
-
|
|
|
- # 销售订单管理
|
|
|
- public function sell_order()
|
|
|
- {
|
|
|
- $where['shop_id'] = $this->shop_id;
|
|
|
-
|
|
|
- $day = Dever::input('day');
|
|
|
-
|
|
|
-
|
|
|
- $this->data = Dever::db('shop/sell_order')->page($where);
|
|
|
-
|
|
|
- if ($this->data) {
|
|
|
- $this->config = Dever::db('shop/sell_order')->config;
|
|
|
- foreach ($this->data as $k => $v) {
|
|
|
- $this->data[$k] = $this->order_info($v);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return $this->data;
|
|
|
- }
|
|
|
-
|
|
|
- # 获取订单详细信息
|
|
|
- public function order_info($info, $type = 1)
|
|
|
- {
|
|
|
- $info['status_name'] = $this->config['status'][$info['status']];
|
|
|
- $info['method_name'] = $this->config['method'][$info['method']];
|
|
|
-
|
|
|
- if ($info['method'] == 1 && $info['status'] > 1) {
|
|
|
-
|
|
|
- }
|
|
|
- $info['goods'] = Dever::db('shop/sell_order_goods')->select(array('order_id' => $info['id']));
|
|
|
- $info['shop'] = Dever::db('shop/info')->find($info['shop_id']);
|
|
|
- $info['cdate'] = date('Y-m-d H:i', $info['cdate']);
|
|
|
-
|
|
|
- if ($type == 2) {
|
|
|
- foreach ($info['goods'] as $k => $v) {
|
|
|
- $info['goods']['info'] = Dever::load('goods/lib/info')->getInfo($v['goods_id']);
|
|
|
- }
|
|
|
- if ($info['address_id']) {
|
|
|
- $info['address'] = Dever::db('passport/address')->find($info['address_id']);
|
|
|
- }
|
|
|
-
|
|
|
- if ($info['invoice_id']) {
|
|
|
- $info['invoice'] = Dever::db('passport/invoice')->find($info['invoice_id']);
|
|
|
- }
|
|
|
-
|
|
|
- if ($info['coupon_id']) {
|
|
|
- $coupon = Dever::db('shop/user_coupon')->find($info['coupon_id']);
|
|
|
- if ($coupon) {
|
|
|
- $info['coupon'] = Dever::db('goods/coupon')->find($coupon['coupon_id']);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return $info;
|
|
|
- }
|
|
|
}
|