|
@@ -102,20 +102,6 @@ class Card extends Common |
|
@@ -102,20 +102,6 @@ class Card extends Common |
|
102
|
* 创建优惠券-选择商户
|
102
|
* 创建优惠券-选择商户
|
|
103
|
*/
|
103
|
*/
|
|
104
|
public function selectseller(){
|
104
|
public function selectseller(){
|
|
105
|
- //获取运营人员列表
|
|
|
|
106
|
- $list= file_get_contents(ON_LINE.'App.Seller.GetSellerById&sellerid='.$data['sid']);
|
|
|
|
107
|
- $array = json_decode($list,TRUE);
|
|
|
|
108
|
- if($array['data']['data']){
|
|
|
|
109
|
- $array['data']['data']['daily'] = json_decode($array['data']['data']['daily'],TRUE);
|
|
|
|
110
|
- $array['data']['data']['daily_time'] = json_decode($array['data']['data']['daily_time'],TRUE);
|
|
|
|
111
|
- $array['data']['data']['cdate'] = date("Y年m月d日 H时i分s秒",$array['data']['data']['cdate']);
|
|
|
|
112
|
- }
|
|
|
|
113
|
- //获取短信流水
|
|
|
|
114
|
- $sms= file_get_contents(ON_LINE.'App.SendSMS.GetSellerSmsFlowing&sid='.$data['sid']);
|
|
|
|
115
|
- $sms_data = json_decode($sms,TRUE);
|
|
|
|
116
|
- $sms_data_list = $sms_data['data'] ? $sms_data['data'] : array();
|
|
|
|
117
|
- $this->assign ( 'smslist',$sms_data_list);
|
|
|
|
118
|
- $this->assign ( 'data',$array['data']['data']);
|
|
|
|
119
|
$this->assign ( 'title','创建卡券');
|
105
|
$this->assign ( 'title','创建卡券');
|
|
120
|
return $this->fetch();
|
106
|
return $this->fetch();
|
|
121
|
}
|
107
|
}
|
|
@@ -215,1283 +201,76 @@ class Card extends Common |
|
@@ -215,1283 +201,76 @@ class Card extends Common |
|
215
|
return $this->fetch();
|
201
|
return $this->fetch();
|
|
216
|
}
|
202
|
}
|
|
217
|
|
203
|
|
|
218
|
-
|
|
|
|
219
|
-
|
|
|
|
220
|
-
|
|
|
|
221
|
-
|
|
|
|
222
|
-
|
|
|
|
223
|
-
|
|
|
|
224
|
-
|
|
|
|
225
|
- /**
|
|
|
|
226
|
- * 停用商家
|
|
|
|
227
|
- */
|
|
|
|
228
|
- public function configStop(){
|
|
|
|
229
|
- if(Request::isAjax()){
|
|
|
|
230
|
- $data = Request::except('file');
|
|
|
|
231
|
- $data['status'] = $data['status'] ? 0 : 1;
|
|
|
|
232
|
- $list= file_get_contents(ON_LINE.'App.Seller.SetStopBySeller&sellerid='.$data['sellerid'].'&status='.$data['status']);
|
|
|
|
233
|
- $array = json_decode($list,TRUE);
|
|
|
|
234
|
- if($array['ret']==200){
|
|
|
|
235
|
- $result['code'] = 1;
|
|
|
|
236
|
- $result['msg'] = 'SUCCESS!';
|
|
|
|
237
|
- }else{
|
|
|
|
238
|
- $result['code'] = 0;
|
|
|
|
239
|
- $result['msg'] = '请求错误!';
|
|
|
|
240
|
- }
|
|
|
|
241
|
- return $result;
|
|
|
|
242
|
- }
|
|
|
|
243
|
- return view();
|
|
|
|
244
|
- }
|
|
|
|
245
|
-
|
|
|
|
246
|
- /**
|
|
|
|
247
|
- * 从商家维度统计:订单、短信等情况
|
|
|
|
248
|
- */
|
|
|
|
249
|
- public function getStatistics(){
|
|
|
|
250
|
- if(Request::isAjax()){
|
|
|
|
251
|
- $data = Request::except('file');
|
|
|
|
252
|
- $key= input('post.key') ? input('post.key') : "";
|
|
|
|
253
|
-
|
|
|
|
254
|
- $sid = $data['sid'] ? implode(',', $data['sid']) : '';
|
|
|
|
255
|
- $sellername = $data['key'] ? $data['key'] : '';
|
|
|
|
256
|
-
|
|
|
|
257
|
- $time = $data['time'] ? explode(' - ', $data['time']) : '';
|
|
|
|
258
|
-
|
|
|
|
259
|
- $stime = $time ? strtotime(date($time[0],time())) : '';
|
|
|
|
260
|
- $etime = $time ? strtotime(date($time[1],time())) : '';
|
|
|
|
261
|
-
|
|
|
|
262
|
- $data['time_type'] = $data['time_type'] ? $data['time_type'] : 1;
|
|
|
|
263
|
- $data['channel'] = $data['channel'] ? $data['channel'] : 1;
|
|
|
|
264
|
-
|
|
|
|
265
|
- $parame = '&page='.$data["page"].'&size='.$data["limit"].'&sellername='.@$sellername.'&stime='.@$stime.'&etime='.@$etime.'&channel='.@$data['channel'].'&sid='.$sid.'&time_type='.@$data['time_type'];
|
|
|
|
266
|
-
|
|
|
|
267
|
- //获取运营人员列表
|
|
|
|
268
|
- $list= file_get_contents(ON_LINE.'App.Report.GetReserveData'.$parame);
|
|
|
|
269
|
-
|
|
|
|
270
|
- $array = json_decode($list,TRUE);
|
|
|
|
271
|
-
|
|
|
|
272
|
- $new_array = array();
|
|
|
|
273
|
- foreach ($array['data'] as $key => $value) {
|
|
|
|
274
|
- if(is_array($value)){
|
|
|
|
275
|
- $new_array[$key]['id'] = $value['id'];
|
|
|
|
276
|
- $new_array[$key]['sellername'] = $value['sellername'];
|
|
|
|
277
|
- $new_array[$key]['contacts_total'] = $value['contacts_total'];
|
|
|
|
278
|
- $new_array[$key]['inviting'] = $value['inviting'];
|
|
|
|
279
|
- $new_array[$key]['reserve_count'] = $value['appReserveCount'] .'/'. $value['AndroidReserveCount'].'/'. $value['CReserveCount'];
|
|
|
|
280
|
- $new_array[$key]['reserve_count_sort'] = $value['appReserveCount'] + $value['AndroidReserveCount'] + $value['CReserveCount'];
|
|
|
|
281
|
- $new_array[$key]['sms_send_count'] = $value['appSmsCount'] .'/'. $value['AndroidSmsCount'];
|
|
|
|
282
|
- $new_array[$key]['sms_send_count_sort'] = $value['appSmsCount'] + $value['AndroidSmsCount'];
|
|
|
|
283
|
- $new_array[$key]['table_room_total'] = $value['table_total'] .'/'. $value['room_total'];
|
|
|
|
284
|
- $new_array[$key]['address_component'] = $value['address_component']['province'] && $value['address_component']['city'] ? $value['address_component']['province'] .'-'. $value['address_component']['city'] : '无法获取地区,请检查经纬度是否正确!';
|
|
|
|
285
|
- }
|
|
|
|
286
|
- }
|
|
|
|
287
|
- return $result = [
|
|
|
|
288
|
- 'code'=>0,'msg'=>'获取成功!',
|
|
|
|
289
|
- 'data'=>$new_array,
|
|
|
|
290
|
- 'count'=>$array['data']['total'],
|
|
|
|
291
|
- 'countReserve'=>$array['data']['appReserveCount']+$array['data']['AndroidReserveCount']+$array['data']['CReserveCount'],
|
|
|
|
292
|
- 'countSms'=>$array['data']['appSmsCount']+$array['data']['AndroidSmsCount'],
|
|
|
|
293
|
- 'inviteeCount'=>$array['data']['inviteeCount'],
|
|
|
|
294
|
- 'appReserveCount'=>$array['data']['appReserveCount'],
|
|
|
|
295
|
- 'AndroidReserveCount'=>$array['data']['AndroidReserveCount'],
|
|
|
|
296
|
- 'CReserveCount'=>$array['data']['CReserveCount'],
|
|
|
|
297
|
- 'appSmsCount'=>$array['data']['appSmsCount'],
|
|
|
|
298
|
- 'AndroidSmsCount'=>$array['data']['AndroidSmsCount'],
|
|
|
|
299
|
- 'Contacts'=>$array['data']['Contacts'],
|
|
|
|
300
|
- 'rel'=>1
|
|
|
|
301
|
- ];
|
|
|
|
302
|
- }
|
|
|
|
303
|
- $this->assign ( 'title','预定订单统计');
|
|
|
|
304
|
- return $this->fetch();
|
|
|
|
305
|
- }
|
|
|
|
306
|
-
|
|
|
|
307
|
- /**
|
|
|
|
308
|
- * 从设备(电话机)维度统计:订单、短信等情况
|
|
|
|
309
|
- */
|
|
|
|
310
|
- public function getEquipment(){
|
|
|
|
311
|
- if(Request::isAjax()){
|
|
|
|
312
|
- $data = Request::except('file');
|
|
|
|
313
|
- $key= input('post.key') ? input('post.key') : "";
|
|
|
|
314
|
-
|
|
|
|
315
|
- $sid = $data['sid'] ? implode(',', $data['sid']) : '';
|
|
|
|
316
|
- $sellername = $data['key'] ? $data['key'] : '';
|
|
|
|
317
|
-
|
|
|
|
318
|
- $time = $data['time'] ? explode(' - ', $data['time']) : '';
|
|
|
|
319
|
-
|
|
|
|
320
|
- $stime = $time ? strtotime(date($time[0],time())) : '';
|
|
|
|
321
|
- $etime = $time ? strtotime(date($time[1],time())) : '';
|
|
|
|
322
|
-
|
|
|
|
323
|
- $data['time_type'] = $data['time_type'] ? $data['time_type'] : 1;
|
|
|
|
324
|
- $data['channel'] = $data['channel'] ? $data['channel'] : 1;
|
|
|
|
325
|
-
|
|
|
|
326
|
- $parame = '&page='.$data["page"].'&size='.$data["limit"].'&sellername='.@$sellername.'&stime='.@$stime.'&etime='.@$etime.'&channel='.@$data['channel'].'&sid='.$sid.'&time_type='.@$data['time_type'];
|
|
|
|
327
|
-
|
|
|
|
328
|
- //获取运营人员列表
|
|
|
|
329
|
- $list= file_get_contents(ON_LINE.'App.Report.GetReserveDataBydev'.$parame);
|
|
|
|
330
|
- $array = json_decode($list,TRUE);
|
|
|
|
331
|
- return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$array['data']['list'],'count'=>$array['data']['total'],'rel'=>1];
|
|
|
|
332
|
- }
|
|
|
|
333
|
- $this->assign ( 'title','设备维度统计预定订单');
|
|
|
|
334
|
- return $this->fetch();
|
|
|
|
335
|
- }
|
|
|
|
336
|
-
|
|
|
|
337
|
- /**
|
|
|
|
338
|
- * 商家菜系、类型配置
|
|
|
|
339
|
- */
|
|
|
|
340
|
- public function sellerconfig(){
|
|
|
|
341
|
- $data = Request::except('file');
|
|
|
|
342
|
- if(Request::isAjax()){
|
|
|
|
343
|
- $cuisine = !empty($data['cuisine']) ? implode(',', array_keys($data['cuisine'])) : '';
|
|
|
|
344
|
- $type = !empty($data['type']) ? implode(',', array_keys($data['type'])) : '';
|
|
|
|
345
|
- $mode = !empty($data['mode']) ? implode(',', array_keys($data['mode'])) : '';
|
|
|
|
346
|
- $sms_code = !empty($data['sms_code']) ? $data['sms_code'] : '';
|
|
|
|
347
|
- $label = !empty($data['label']) ? implode(',', array_keys($data['label'])) : '';
|
|
|
|
348
|
- $brand = !empty($data['brand']) ? implode(',', array_keys($data['brand'])) : '';
|
|
|
|
349
|
- $label_1_ = !empty($data['label_1_']) ? implode(',', array_keys($data['label_1_'])) : '';
|
|
|
|
350
|
- $label_2_ = !empty($data['label_2_']) ? implode(',', array_keys($data['label_2_'])) : '';
|
|
|
|
351
|
- $label_3_ = !empty($data['label_3_']) ? implode(',', array_keys($data['label_3_'])) : '';
|
|
|
|
352
|
- $is_checked_call = !empty($data['is_checked_call']) ? $data['is_checked_call'] : '';
|
|
|
|
353
|
- $is_checked_lite = !empty($data['is_checked_lite']) ? $data['is_checked_lite'] : '';
|
|
|
|
354
|
-
|
|
|
|
355
|
- if(isset($data['reserve_mode'])) {
|
|
|
|
356
|
- //需要修改 接单设备信息
|
|
|
|
357
|
- if($data['reserve_mode']==1){
|
|
|
|
358
|
- if($is_checked_lite)
|
|
|
|
359
|
- $up=Db::query("UPDATE `xt-member-two-LINE`.xt_dc_dz_seller_config set is_checked_lite = 1 where sid = ".$data['sellerid']);
|
|
|
|
360
|
- else
|
|
|
|
361
|
- $up=Db::query("UPDATE `xt-member-two-LINE`.xt_dc_dz_seller_config set is_checked_lite = 0 where sid = ".$data['sellerid']);
|
|
|
|
362
|
- if($is_checked_call)
|
|
|
|
363
|
- $up=Db::query("UPDATE `xt-member-two-LINE`.xt_dc_dz_seller_config set is_checked_call = 1 where sid = ".$data['sellerid']);
|
|
|
|
364
|
- else
|
|
|
|
365
|
- $up=Db::query("UPDATE `xt-member-two-LINE`.xt_dc_dz_seller_config set is_checked_call = 0 where sid = ".$data['sellerid']);
|
|
|
|
366
|
- }
|
|
|
|
367
|
- $up=Db::query("UPDATE `xt-member-two-LINE`.xt_dc_dz_seller_config set reserve_mode = ".$data['reserve_mode']." where sid = ".$data['sellerid']);
|
|
|
|
368
|
- }
|
|
|
|
369
|
-
|
|
|
|
370
|
- if($sms_code)
|
|
|
|
371
|
- $res_sms_code= file_get_contents(ON_LINE.'App.SendSMS.SetSellerSmsTemplate&sid='.$data['sellerid'].'&sms_id='.$sms_code);
|
|
|
|
372
|
-
|
|
|
|
373
|
- if($cuisine)
|
|
|
|
374
|
- $res_cuisine= file_get_contents(ON_LINE.'App.Seller.SetSellerCuisine&sellerid='.$data['sellerid'].'&cid='.$cuisine);
|
|
|
|
375
|
- //$res_cuisine = json_decode($res_cuisine,TRUE);
|
|
|
|
376
|
- if($type)
|
|
|
|
377
|
- $res_type= file_get_contents(ON_LINE.'App.Seller.SetSellerType&sellerid='.$data['sellerid'].'&typeid='.$type);
|
|
|
|
378
|
- //$res_type = json_decode($res_type,TRUE);
|
|
|
|
379
|
-
|
|
|
|
380
|
- if($mode)
|
|
|
|
381
|
- $res_mode= file_get_contents(ON_LINE.'App.Seller.setSellerMode&sellerid='.$data['sellerid'].'&modeid='.$mode);
|
|
|
|
382
|
- //$res_mode = json_decode($res_mode,TRUE);
|
|
|
|
383
|
- if($label)
|
|
|
|
384
|
- $res_label= file_get_contents(ON_LINE.'App.Seller.setSellerLabel&sid='.$data['sellerid'].'&field='.$label);
|
|
|
|
385
|
-
|
|
|
|
386
|
- if($brand){
|
|
|
|
387
|
- $del=Db::query("DELETE FROM `xt-member-two-LINE`.xt_dc_dz_seller_brand_rel WHERE sid =".$data['sellerid']);
|
|
|
|
388
|
- $add=Db::query("INSERT INTO `xt-member-two-LINE`.xt_dc_dz_seller_brand_rel VALUES(".$data['sellerid'].",".$brand.")");
|
|
|
|
389
|
- }
|
|
|
|
390
|
-
|
|
|
|
391
|
- if($label_1_){
|
|
|
|
392
|
- $del=Db::query("DELETE FROM `xt-member-two-LINE`.xt_dc_dz_seller_label_c_rel WHERE sid = ".$data['sellerid']." AND lcid in (SELECT id FROM `xt-member-two-LINE`.xt_dc_dz_seller_label_c WHERE pid = 1)");
|
|
|
|
393
|
- $add=Db::query("INSERT INTO `xt-member-two-LINE`.xt_dc_dz_seller_label_c_rel VALUES(".$data['sellerid'].",".$label_1_.")");
|
|
|
|
394
|
- }
|
|
|
|
395
|
-
|
|
|
|
396
|
- if($label_2_){
|
|
|
|
397
|
- $del=Db::query("DELETE FROM `xt-member-two-LINE`.xt_dc_dz_seller_label_c_rel WHERE sid = ".$data['sellerid']." AND lcid in (SELECT id FROM `xt-member-two-LINE`.xt_dc_dz_seller_label_c WHERE pid = 2)");
|
|
|
|
398
|
- $add=Db::query("INSERT INTO `xt-member-two-LINE`.xt_dc_dz_seller_label_c_rel VALUES(".$data['sellerid'].",".$label_2_.")");
|
|
|
|
399
|
- }
|
|
|
|
400
|
-
|
|
|
|
401
|
- if($label_3_){
|
|
|
|
402
|
- $del=Db::query("DELETE FROM `xt-member-two-LINE`.xt_dc_dz_seller_label_c_rel WHERE sid = ".$data['sellerid']." AND lcid in (SELECT id FROM `xt-member-two-LINE`.xt_dc_dz_seller_label_c WHERE pid = 3)");
|
|
|
|
403
|
- $add=Db::query("INSERT INTO `xt-member-two-LINE`.xt_dc_dz_seller_label_c_rel VALUES(".$data['sellerid'].",".$label_3_.")");
|
|
|
|
404
|
- }
|
|
|
|
405
|
-
|
|
|
|
406
|
- if(isset($data['edition'])){
|
|
|
|
407
|
- $up=Db::query("UPDATE `xt-member-two-LINE`.xt_seller set is_online_reserve = ".$data['edition']." where id = ".$data['sellerid']);
|
|
|
|
408
|
- }
|
|
|
|
409
|
-
|
|
|
|
410
|
- if(isset($data['is_tele'])){
|
|
|
|
411
|
- $up=Db::query("UPDATE `xt-member-two-LINE`.xt_seller set is_tele = ".$data['is_tele']." where id = ".$data['sellerid']);
|
|
|
|
412
|
- }
|
|
|
|
413
|
-
|
|
|
|
414
|
-
|
|
|
|
415
|
- $result['code'] = 1;
|
|
|
|
416
|
- $result['msg'] = "配置成功!";
|
|
|
|
417
|
- return $result;
|
|
|
|
418
|
- }
|
|
|
|
419
|
-
|
|
|
|
420
|
- //获取商家已有菜系
|
|
|
|
421
|
- $cuisine_list= file_get_contents(ON_LINE.'App.Seller.getSellerCuisine&sellerid='.$data['id']);
|
|
|
|
422
|
- $cuisine_list = json_decode($cuisine_list,TRUE);
|
|
|
|
423
|
- //获取所有菜系
|
|
|
|
424
|
- $list= file_get_contents(ON_LINE.'App.Reserve.GetCustomerConfig');
|
|
|
|
425
|
- $array = json_decode($list,TRUE);
|
|
|
|
426
|
- //组装数据
|
|
|
|
427
|
- foreach ($cuisine_list['data'] as $key => $value) {
|
|
|
|
428
|
- foreach ($array['data']['cate'] as $k => $v) {
|
|
|
|
429
|
- if($value['cid']==$v['id']){
|
|
|
|
430
|
- $array['data']['cate'][$k]['checked'] = 1;
|
|
|
|
431
|
- }
|
|
|
|
432
|
- }
|
|
|
|
433
|
- }
|
|
|
|
434
|
- $this->assign('list',$array['data']['cate']);//获取所有菜系
|
|
|
|
435
|
-
|
|
|
|
436
|
- //获取商家已有来源
|
|
|
|
437
|
- $type_list= file_get_contents(ON_LINE.'App.Seller.GetSellerType&sellerid='.$data['id']);
|
|
|
|
438
|
- $type_list = json_decode($type_list,TRUE);
|
|
|
|
439
|
- //获取来源
|
|
|
|
440
|
- $channel = array(array('id'=>1,'name'=>'合作'),array('id'=>2,'name'=>'推广'),array('id'=>3,'name'=>'测试'));
|
|
|
|
441
|
- //组装数据
|
|
|
|
442
|
- foreach ($type_list['data'] as $key => $value) {
|
|
|
|
443
|
- foreach ($channel as $k => $v) {
|
|
|
|
444
|
- if($value['type_id']==$v['id']){
|
|
|
|
445
|
- $channel[$k]['checked'] = 1;
|
|
|
|
446
|
- }
|
|
|
|
447
|
- }
|
|
|
|
448
|
- }
|
|
|
|
449
|
- $this->assign('channel',$channel);//获取所有来源
|
|
|
|
450
|
-
|
|
|
|
451
|
- //获取商家已有地图显示方式
|
|
|
|
452
|
- $mode_list= file_get_contents(ON_LINE.'App.Seller.getSellerMode&sellerid='.$data['id']);
|
|
|
|
453
|
- $mode_list = json_decode($mode_list,TRUE);
|
|
|
|
454
|
-
|
|
|
|
455
|
- //获取所有地图显示方式
|
|
|
|
456
|
- $mode= array(array('id'=>1,'name'=>'地图上大图标'),array('id'=>2,'name'=>'地图上文字'));
|
|
|
|
457
|
- //组装数据
|
|
|
|
458
|
- foreach ($mode_list['data'] as $key => $value) {
|
|
|
|
459
|
- foreach ($mode as $k => $v) {
|
|
|
|
460
|
- if($value['sm_id']==$v['id']){
|
|
|
|
461
|
- $mode[$k]['checked'] = 1;
|
|
|
|
462
|
- }
|
|
|
|
463
|
- }
|
|
|
|
464
|
- }
|
|
|
|
465
|
- $this->assign('mode',$mode);//获取所有菜系
|
|
|
|
466
|
-
|
|
|
|
467
|
- //获取商家已选短信模板
|
|
|
|
468
|
- $template = file_get_contents(ON_LINE.'App.Reserve.SellerInfo&seller_id='.$data['id']);
|
|
|
|
469
|
- $template = json_decode($template,TRUE);
|
|
|
|
470
|
- //获取短信模板列表
|
|
|
|
471
|
- $template_list = file_get_contents(ON_LINE.'App.SendSMS.GetSmsTemplate');
|
|
|
|
472
|
- $template_list = json_decode($template_list,TRUE);
|
|
|
|
473
|
-
|
|
|
|
474
|
- //组装数据
|
|
|
|
475
|
- foreach ($template_list['data'] as $key => $value) {
|
|
|
|
476
|
- if($value['template_code']==$template['data']['setting']['template_code']){
|
|
|
|
477
|
- $template_list['data'][$key]['checked'] = 1;
|
|
|
|
478
|
- }
|
|
|
|
479
|
- switch ($value['template_code']) {
|
|
|
|
480
|
- case 'SMS_163050401':
|
|
|
|
481
|
- $vowels = array(
|
|
|
|
482
|
- '周到安排演示店' => '${seller_name}',
|
|
|
|
483
|
- '11月25日晚上18:00' => '${date}',
|
|
|
|
484
|
- '金台夕照、卢沟晓月' =>'${region_room_name}',
|
|
|
|
485
|
- '西电路447号南湖金地西门南100米' =>'${seller_addr}',
|
|
|
|
486
|
- '18792581193' =>'${seller_phone}',
|
|
|
|
487
|
- '毛毛' =>'${cusman}',
|
|
|
|
488
|
- );
|
|
|
|
489
|
- break;
|
|
|
|
490
|
- case 'SMS_162733710':
|
|
|
|
491
|
- $vowels = array(
|
|
|
|
492
|
- '4月6日中午' => '${reserve_date}',
|
|
|
|
493
|
- '周到1店西电路447号金台夕照' => '${seller_name_addr_room}',
|
|
|
|
494
|
- '毛毛' =>'${cusman}',
|
|
|
|
495
|
- );
|
|
|
|
496
|
- break;
|
|
|
|
497
|
- case 'SMS_154587043':
|
|
|
|
498
|
- $vowels = array(
|
|
|
|
499
|
- '侯先生' => '${guest}',
|
|
|
|
500
|
- '周到安排演示店' => '${seller_name}',
|
|
|
|
501
|
- '11月25日晚上18:00' =>'${date}',
|
|
|
|
502
|
- '包间(金台夕照)' =>'${region_room_name}',
|
|
|
|
503
|
- '西电路447号南湖金地西门南100米' =>'${seller_addr}',
|
|
|
|
504
|
- '18792581193' =>'${seller_phone}\n',
|
|
|
|
505
|
- '毛毛' =>'${cusman}',
|
|
|
|
506
|
- );
|
|
|
|
507
|
- break;
|
|
|
|
508
|
- case 'SMS_164277855':
|
|
|
|
509
|
- $vowels = array(
|
|
|
|
510
|
- '周到1店西电路447号' => '${seller_name}',
|
|
|
|
511
|
- '11月7日晚上18:30' => '${date}',
|
|
|
|
512
|
- '包间(金台夕照)' =>'${region_room_name}',
|
|
|
|
513
|
- '1879258119' =>'${seller_phone}',
|
|
|
|
514
|
- );
|
|
|
|
515
|
- break;
|
|
|
|
516
|
- case 'SMS_164268239':
|
|
|
|
517
|
- $vowels = array(
|
|
|
|
518
|
- '周到安排演示店' => '${seller_name}',
|
|
|
|
519
|
- '11月7日晚上18:30' => '${date}',
|
|
|
|
520
|
- '包间(金台夕照)' =>'${region_room_name}',
|
|
|
|
521
|
- '西电路447号南湖金地西门南100米' =>'${seller_addr}',
|
|
|
|
522
|
- '1879258119' =>'${seller_phone}',
|
|
|
|
523
|
- );
|
|
|
|
524
|
- break;
|
|
|
|
525
|
- case 'SMS_181200398':
|
|
|
|
526
|
- $vowels = array(
|
|
|
|
527
|
- '周到安排演示店' => '${sellershortname}',
|
|
|
|
528
|
- '11月7日' => '${date}',
|
|
|
|
529
|
- '晚上' =>'${mealtime}',
|
|
|
|
530
|
- '1F' =>'${regionname}',
|
|
|
|
531
|
- '<<金台夕照>>' =>'${roomname}',
|
|
|
|
532
|
- '西电路447号南湖金地西门南100米' =>'${selleraddr}',
|
|
|
|
533
|
- '1879258119' =>'${sellerphone}',
|
|
|
|
534
|
- );
|
|
|
|
535
|
- break;
|
|
|
|
536
|
- case 'SMS_181210420':
|
|
|
|
537
|
- $vowels = array(
|
|
|
|
538
|
- '周到安排演示店' => '${salename}',
|
|
|
|
539
|
- '11月7日晚上' => '${date_solt}',
|
|
|
|
540
|
- '三楼4号院' =>'${regonname}',
|
|
|
|
541
|
- '【金台夕照】' =>'${roomname}',
|
|
|
|
542
|
- '西电路447号南湖金地西门南100米' =>'${selleraddr}',
|
|
|
|
543
|
- '出门左转' =>'${sellertips}',
|
|
|
|
544
|
- '毛毛' =>'${managername}',
|
|
|
|
545
|
- '1879258119' =>'${managerphone}',
|
|
|
|
546
|
- );
|
|
|
|
547
|
- break;
|
|
|
|
548
|
- default:
|
|
|
|
549
|
- # code...
|
|
|
|
550
|
- break;
|
|
|
|
551
|
- }
|
|
|
|
552
|
- $template_list['data'][$key]['content'] = str_replace($vowels, array_keys($vowels),$value['content']);
|
|
|
|
553
|
- }
|
|
|
|
554
|
- $this->assign('template_list',$template_list['data']);//获取短信模板列表
|
|
|
|
555
|
-
|
|
|
|
556
|
- //获取商家接单方式
|
|
|
|
557
|
- $seller_config_res = Db::query('SELECT * from `xt-member-two-LINE`.xt_dc_dz_seller_config where sid ='.$data['id'].' GROUP by sid');
|
|
|
|
558
|
- if(@$seller_config_res[0])
|
|
|
|
559
|
- $this->assign('seller_config_res',$seller_config_res[0]);
|
|
|
|
560
|
-
|
|
|
|
561
|
- $seller_user_openid_array = array();
|
|
|
|
562
|
- //获取小程序是否可选择
|
|
|
|
563
|
- $seller_user_openid_array = Db::query('SELECT
|
|
|
|
564
|
- a.openid,
|
|
|
|
565
|
- u.nick_name,
|
|
|
|
566
|
- u.phone
|
|
|
|
567
|
- FROM
|
|
|
|
568
|
- `xt-member-two-LINE`.xt_dc_seller_user AS u
|
|
|
|
569
|
- LEFT JOIN `xt-member-two-LINE`.xt_auth_user AS a ON u.auth_user_id = a.id
|
|
|
|
570
|
- WHERE
|
|
|
|
571
|
- u.is_on_call = 1
|
|
|
|
572
|
- AND u.sellerid = '.$data['id']);
|
|
|
|
573
|
- $seller_user_openid = $seller_user_openid_array ? $seller_user_openid_array[0]['openid'] : '';
|
|
|
|
574
|
-
|
|
|
|
575
|
- if($seller_user_openid_array[0]['phone']==NULL || $seller_user_openid_array[0]['phone'] ==''){
|
|
|
|
576
|
- $seller_user_openid_array[0]['phone'] = '电话未填写';
|
|
|
|
577
|
- $seller_user_openid_array[0]['phone_status'] = 1;
|
|
|
|
578
|
- }
|
|
|
|
579
|
- //检测是否关注公众号
|
|
|
|
580
|
- if($seller_user_openid){
|
|
|
|
581
|
- $seller_user_unionid = Db::query('SELECT
|
|
|
|
582
|
- openid
|
|
|
|
583
|
- FROM
|
|
|
|
584
|
- `xt-member-two-LINE`.xt_wechat
|
|
|
|
585
|
- WHERE
|
|
|
|
586
|
- unionid = ( SELECT unionid FROM `xt-member-two-LINE`.xt_wechat WHERE openid = "'.$seller_user_openid.'" )
|
|
|
|
587
|
- AND source = 0');
|
|
|
|
588
|
- $seller_user_unionid = $seller_user_unionid ? $seller_user_unionid[0]['openid'] : '';
|
|
|
|
589
|
- //未关注公众号则不能勾选小程序
|
|
|
|
590
|
- if($seller_user_unionid==''){
|
|
|
|
591
|
- $seller_user_openid_array[0]['is_openid_wechat'] = 0;
|
|
|
|
592
|
- $seller_user_openid_array[0]['is_openid_wechat_str'] = '未关注公众号';
|
|
|
|
593
|
- }else{
|
|
|
|
594
|
- $seller_user_openid_array[0]['is_openid_wechat'] = 1;
|
|
|
|
595
|
- $seller_user_openid_array[0]['is_openid_wechat_str'] = '已关注公众号';
|
|
|
|
596
|
- }
|
|
|
|
597
|
- }
|
|
|
|
598
|
-
|
|
|
|
599
|
- $this->assign('seller_user_openid_array',$seller_user_openid_array[0]);
|
|
|
|
600
|
-
|
|
|
|
601
|
-
|
|
|
|
602
|
- //获取商家拥有哪些标签
|
|
|
|
603
|
- $label_list= file_get_contents(ON_LINE.'App.Seller.GetSellerLabel&sid='.$data['id']);
|
|
|
|
604
|
- $label_list = json_decode($label_list,TRUE);
|
|
|
|
605
|
- $this->assign('label_list',$label_list['data']);
|
|
|
|
606
|
-
|
|
|
|
607
|
- //商家标签
|
|
|
|
608
|
- //原生:
|
|
|
|
609
|
- //$label_c=Db::query("SELECT * from xt-member-two-LINE.xt_dc_dz_seller_label_c");
|
|
|
|
610
|
- $label_c=Db::table("xt-member-two-LINE.xt_dc_dz_seller_label_c")->select();
|
|
|
|
611
|
- $label_c_rel=Db::table("xt-member-two-LINE.xt_dc_dz_seller_label_c_rel")->where(array('sid'=>$data['id']))->select();
|
|
|
|
612
|
- //组装数据
|
|
|
|
613
|
- foreach ($label_c as $key => $value) {
|
|
|
|
614
|
- foreach ($label_c_rel as $k => $v) {
|
|
|
|
615
|
- if($value['id']==$v['lcid']){
|
|
|
|
616
|
- $label_c[$key]['checked'] = 1;
|
|
|
|
617
|
- }
|
|
|
|
618
|
- }
|
|
|
|
619
|
- }
|
|
|
|
620
|
- $this->assign('label_c',$label_c);
|
|
|
|
621
|
-
|
|
|
|
622
|
- //商家品牌
|
|
|
|
623
|
- $brand=Db::table("xt-member-two-LINE.xt_dc_dz_seller_brand")->select();
|
|
|
|
624
|
- $brand_rel=Db::table("xt-member-two-LINE.xt_dc_dz_seller_brand_rel")->where(array('sid'=>$data['id']))->select();
|
|
|
|
625
|
- //组装数据
|
|
|
|
626
|
- foreach ($brand as $key => $value) {
|
|
|
|
627
|
- foreach ($brand_rel as $k => $v) {
|
|
|
|
628
|
- if($value['id']==$v['bid']){
|
|
|
|
629
|
- $brand[$key]['checked'] = 1;
|
|
|
|
630
|
- }
|
|
|
|
631
|
- }
|
|
|
|
632
|
- }
|
|
|
|
633
|
- $this->assign('brand',$brand);
|
|
|
|
634
|
-
|
|
|
|
635
|
-
|
|
|
|
636
|
- $is_online_reserve=Db::table("xt-member-two-LINE.xt_seller")->where(array('id'=>$data['id']))->select();
|
|
|
|
637
|
-
|
|
|
|
638
|
- //获取商家在线预定版本情况
|
|
|
|
639
|
- $this->assign('is_online_reserve',$is_online_reserve[0]['is_online_reserve']);
|
|
|
|
640
|
- //是否安装电话机
|
|
|
|
641
|
- $this->assign('is_tele',$is_online_reserve[0]['is_tele']);
|
|
|
|
642
|
-
|
|
|
|
643
|
- //商户信息
|
|
|
|
644
|
- $this->assign ('data',$data);
|
|
|
|
645
|
- $this->assign ( 'title','商户信息配置' );
|
|
|
|
646
|
- return $this->fetch();
|
|
|
|
647
|
- }
|
|
|
|
648
|
-
|
|
|
|
649
|
- /**
|
|
|
|
650
|
- * 商家基础信息配置
|
|
|
|
651
|
- */
|
|
|
|
652
|
- public function setsellerconfig(){
|
|
|
|
653
|
- if(Request::isAjax()){
|
|
|
|
654
|
- $data = Request::except('file');
|
|
|
|
655
|
- $data['status'] = $data['status'] ? 0 : 1;
|
|
|
|
656
|
- $list= file_get_contents(ON_LINE.'App.Seller.SetSellerConfigByPC&sid='.$data['sellerid'].'&field='.$data['field'].'&value='.$data['value']);
|
|
|
|
657
|
- $array = json_decode($list,TRUE);
|
|
|
|
658
|
- if($array['ret']==200){
|
|
|
|
659
|
- $result['code'] = 1;
|
|
|
|
660
|
- $result['msg'] = 'SUCCESS!';
|
|
|
|
661
|
- }else{
|
|
|
|
662
|
- $result['code'] = 0;
|
|
|
|
663
|
- $result['msg'] = '请求错误!';
|
|
|
|
664
|
- }
|
|
|
|
665
|
- return $result;
|
|
|
|
666
|
- }
|
|
|
|
667
|
- return view();
|
|
|
|
668
|
- }
|
|
|
|
669
|
-
|
|
|
|
670
|
-
|
|
|
|
671
|
- //商家列表 用于配置商家活动
|
|
|
|
672
|
- public function seller_activity_list(){
|
|
|
|
673
|
- if(Request::isAjax()){
|
|
|
|
674
|
- $data = Request::except('file');
|
|
|
|
675
|
- $key= input('post.key') ? input('post.key') : "";
|
|
|
|
676
|
- $channel = @$key['channel'] ? @$key['channel'] : 1;
|
|
|
|
677
|
- $limit = '&x='.$data["page"].'&y='.$data["limit"].'&keywords='.@$key['id'].'&channel='.$channel;
|
|
|
|
678
|
-
|
|
|
|
679
|
- //获取运营人员列表
|
|
|
|
680
|
- $list= file_get_contents(ON_LINE.'App.Seller.GetSellerListByActivity'.$limit);
|
|
|
|
681
|
- $array = json_decode($list,TRUE);
|
|
|
|
682
|
- foreach($array['data'][0]['data'] as $key=>$value){
|
|
|
|
683
|
- if(!empty($value['activity'])){
|
|
|
|
684
|
- foreach ($value['activity'] as $k => $v) {
|
|
|
|
685
|
- $str[$key][] = ($k+1).'、'.$v['title'];
|
|
|
|
686
|
- }
|
|
|
|
687
|
- $array['data'][0]['data'][$key]['activity'] = implode('<br/>', $str[$key]);
|
|
|
|
688
|
- //$array['data'][0]['data'][$key]['activity'] = implode('<br/>', array_column($value['activity'], 'title'));
|
|
|
|
689
|
- }
|
|
|
|
690
|
- }
|
|
|
|
691
|
- return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$array['data'][0]['data'],'count'=>$array['data'][0]['total'],'rel'=>1];
|
|
|
|
692
|
- }
|
|
|
|
693
|
- $this->assign ( 'title','商家活动配置');
|
|
|
|
694
|
- return $this->fetch();
|
|
|
|
695
|
- }
|
|
|
|
696
|
-
|
|
|
|
697
|
/**
|
204
|
/**
|
|
698
|
- * 商家活动列表页
|
205
|
+ * 商家卡券-卡券投放-卡券列表
|
|
699
|
*/
|
206
|
*/
|
|
700
|
- public function seller_activity(){
|
|
|
|
701
|
- $data = Request::except('file');
|
|
|
|
702
|
- //获取商家现有活动
|
|
|
|
703
|
- $seller_activity= file_get_contents(ON_LINE.'App.Seller.GetSellerActivity&sid='.$data['id']);
|
|
|
|
704
|
- $seller_activity = json_decode($seller_activity,TRUE);
|
|
|
|
705
|
- //活动列表
|
|
|
|
706
|
- $this->assign('sid',$data['id']);
|
|
|
|
707
|
- $this->assign ( 'seller_activity',$seller_activity['data']);
|
|
|
|
708
|
- $this->assign ( 'title','商家活动配置页面');
|
|
|
|
709
|
- return $this->fetch();
|
|
|
|
710
|
- }
|
|
|
|
711
|
-
|
|
|
|
712
|
- //添加活动
|
|
|
|
713
|
- public function add_activity(){
|
|
|
|
714
|
- $data = Request::except('file');
|
|
|
|
715
|
- if(Request::isAjax()){
|
|
|
|
716
|
- switch ($data['type']) {
|
|
|
|
717
|
- case '1':
|
|
|
|
718
|
- if($data['max_num']==0){
|
|
|
|
719
|
- $data['title'] = '立减'.$data['min_num'];break;
|
|
|
|
720
|
- }else{
|
|
|
|
721
|
- $data['title'] = '满'.$data['max_num'].'立减'.$data['min_num'];break;
|
|
|
|
722
|
- }
|
|
|
|
723
|
- case '2':
|
|
|
|
724
|
- if($data['max_num']==0){
|
|
|
|
725
|
- $data['title'] = '赠'.$data['min_num'];break;
|
|
|
|
726
|
- }else{
|
|
|
|
727
|
- $data['title'] = '满'.$data['max_num'].'赠'.$data['min_num'];break;
|
|
|
|
728
|
- }
|
|
|
|
729
|
- break;
|
|
|
|
730
|
- case '3':
|
|
|
|
731
|
- if($data['max_num']==0){
|
|
|
|
732
|
- $data['title'] = $data['min_num'].'折';break;
|
|
|
|
733
|
- }else{
|
|
|
|
734
|
- $data['title'] = '满'.$data['max_num'].'立享'.$data['min_num'].'折';break;
|
|
|
|
735
|
- }
|
|
|
|
736
|
- case '4':
|
|
|
|
737
|
- $data['title'] = $data['max_num'].'元代金券';
|
|
|
|
738
|
- break;
|
|
|
|
739
|
- case '5':
|
|
|
|
740
|
- $data['title'] = '会员价';
|
|
|
|
741
|
- break;
|
|
|
|
742
|
- default:
|
|
|
|
743
|
- # code...
|
|
|
|
744
|
- break;
|
|
|
|
745
|
- }
|
|
|
|
746
|
-
|
|
|
|
747
|
- //字段空值过滤
|
|
|
|
748
|
- //添加活动
|
|
|
|
749
|
- $res= file_get_contents(ON_LINE.'App.Seller.SetActivity&str='.serialize($data));
|
|
|
|
750
|
- $res = json_decode($res,TRUE);
|
|
|
|
751
|
- if($data['aid']){
|
|
|
|
752
|
- if($res['data']){
|
|
|
|
753
|
- $result = ['code'=>1,'msg'=>'修改成功!','rel'=>1];
|
|
|
|
754
|
- }else{
|
|
|
|
755
|
- $result = ['code'=>0,'msg'=>'修改失败!','rel'=>1];
|
|
|
|
756
|
- }
|
|
|
|
757
|
- }else{
|
|
|
|
758
|
- if($res['data']){
|
|
|
|
759
|
- $result = ['code'=>1,'msg'=>'添加成功!','rel'=>1];
|
|
|
|
760
|
- }else{
|
|
|
|
761
|
- $result = ['code'=>0,'msg'=>'添加失败!','rel'=>1];
|
|
|
|
762
|
- }
|
|
|
|
763
|
- }
|
|
|
|
764
|
- return $result;
|
|
|
|
765
|
- }
|
|
|
|
766
|
- if($data['id']){
|
|
|
|
767
|
- //修改---需要获取对应的数据
|
|
|
|
768
|
- $activity= file_get_contents(ON_LINE.'App.Seller.GetSellerActivityById&id='.$data['id']);
|
|
|
|
769
|
- $activity = json_decode($activity,TRUE);
|
|
|
|
770
|
- $this->assign ('data',$activity['data']);
|
|
|
|
771
|
- $this->assign ( 'title','修改活动');
|
|
|
|
772
|
- }
|
|
|
|
773
|
- $this->assign ( 'hid',$data['sid']);
|
|
|
|
774
|
- $this->assign ( 'title','添加活动');
|
|
|
|
775
|
- return $this->fetch();
|
|
|
|
776
|
- }
|
|
|
|
777
|
-
|
|
|
|
778
|
- //删除活动
|
|
|
|
779
|
- public function del_activity(){
|
|
|
|
780
|
- $data = Request::except('file');
|
|
|
|
781
|
- $res= file_get_contents(ON_LINE.'App.Seller.DelSellerActivity&sid='.$data['sid'].'&aid='.$data['aid']);
|
|
|
|
782
|
- $res = json_decode($res,TRUE);
|
|
|
|
783
|
- $this->redirect('Seller/seller_activity', ['id' => $data['sid']]);
|
|
|
|
784
|
- //return $this->fetch('seller_activity',['id' => $data['sid']]);
|
|
|
|
785
|
- }
|
|
|
|
786
|
-
|
|
|
|
787
|
- //商家设备列表
|
|
|
|
788
|
- public function device_list(){
|
|
|
|
789
|
- //获取类型
|
|
|
|
790
|
- $facturer = Db::query("SELECT * FROM `xt-member-two-LINE`.xt_dc_dz_facturer");
|
207
|
+ public function cardput(){
|
|
791
|
if(Request::isAjax()){
|
208
|
if(Request::isAjax()){
|
|
792
|
$data = Request::except('file');
|
209
|
$data = Request::except('file');
|
|
793
|
- $channel = @$data['channel'] ? @$data['channel'] : 1;
|
|
|
|
794
|
- $manufacturer = @$data['manufacturer'] ? @$data['manufacturer'] : 1;
|
|
|
|
795
|
-
|
|
|
|
796
|
- $limit = '&page='.$data["page"].'&size='.$data["limit"].'&sellername='.@$data['key'].'&channel='.$channel.'&type='.$manufacturer;
|
|
|
|
797
|
|
210
|
|
|
798
|
- //获取运营人员列表
|
|
|
|
799
|
- $list= file_get_contents(ON_LINE.'App.Device.GetDeviceOnlineStatus'.$limit); //GetSellerDevice
|
|
|
|
800
|
- $array = json_decode($list,TRUE);
|
|
|
|
801
|
- foreach ($array['data']['list'] as $key => $value) {
|
|
|
|
802
|
- switch ($value['type']) {
|
|
|
|
803
|
- case '0':
|
|
|
|
804
|
- $array['data']['list'][$key]['type'] = $facturer[0]['facturer'];
|
|
|
|
805
|
- break;
|
|
|
|
806
|
- case '1':
|
|
|
|
807
|
- $array['data']['list'][$key]['type'] = $facturer[0]['facturer'];
|
|
|
|
808
|
- break;
|
|
|
|
809
|
- case '2':
|
|
|
|
810
|
- $array['data']['list'][$key]['type'] = $facturer[1]['facturer'];
|
|
|
|
811
|
- break;
|
|
|
|
812
|
- case '3':
|
|
|
|
813
|
- $array['data']['list'][$key]['type'] = $facturer[2]['facturer'];
|
|
|
|
814
|
- break;
|
|
|
|
815
|
- case '4':
|
|
|
|
816
|
- $array['data']['list'][$key]['type'] = $facturer[3]['facturer'];
|
|
|
|
817
|
- break;
|
|
|
|
818
|
-
|
|
|
|
819
|
- default:
|
|
|
|
820
|
- $array['data']['list'][$key]['type'] = 'error: '.$value['type'];
|
|
|
|
821
|
- break;
|
|
|
|
822
|
- }
|
|
|
|
823
|
-
|
|
|
|
824
|
- }
|
|
|
|
825
|
- return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$array['data']['list'],'count'=>$array['data']['total'],'rel'=>1];
|
|
|
|
826
|
- }
|
|
|
|
827
|
- $this->assign ( 'facturer',$facturer);
|
|
|
|
828
|
- $this->assign ( 'title','商家设备列表');
|
|
|
|
829
|
- return $this->fetch();
|
|
|
|
830
|
- }
|
|
|
|
831
|
-
|
|
|
|
832
|
- //商家设备列表
|
|
|
|
833
|
- public function add_gray_user(){
|
|
|
|
834
|
- if(Request::isAjax()){
|
|
|
|
835
|
- $data = Request::except('file');
|
|
|
|
836
|
- $list= file_get_contents(ON_LINE.'App.Device.SetGrayUser&ids='.serialize($data['id']));
|
|
|
|
837
|
- $array = json_decode($list,TRUE);
|
|
|
|
838
|
- if($array['ret']==200){
|
|
|
|
839
|
- $result['code'] = 1;
|
|
|
|
840
|
- $result['msg'] = 'SUCCESS!';
|
|
|
|
841
|
- }else{
|
|
|
|
842
|
- $result['code'] = 0;
|
|
|
|
843
|
- $result['msg'] = '服务器错误,请勿重复将设备号添加到灰度用户!';
|
|
|
|
844
|
- }
|
|
|
|
845
|
- return $result;
|
|
|
|
846
|
- }
|
|
|
|
847
|
- return view();
|
|
|
|
848
|
- }
|
|
|
|
849
|
-
|
|
|
|
850
|
- //灰度用户列表
|
|
|
|
851
|
- public function gray_user_list(){
|
|
|
|
852
|
- //获取类型
|
|
|
|
853
|
- $facturer = Db::query("SELECT * FROM `xt-member-two-LINE`.xt_dc_dz_facturer");
|
|
|
|
854
|
- $this->assign ( 'facturer',$facturer);
|
|
|
|
855
|
- if(Request::isAjax()){
|
|
|
|
856
|
- $data = Request::except('file');
|
|
|
|
857
|
- $channel = @$data['channel'] ? @$data['channel'] : 1;
|
|
|
|
858
|
- $manufacturer = @$data['manufacturer'] ? @$data['manufacturer'] : 1;
|
|
|
|
859
|
-
|
|
|
|
860
|
- $limit = '&page='.$data["page"].'&size='.$data["limit"].'&sellername='.@$data['key'].'&channel='.$channel.'&type='.$manufacturer;
|
|
|
|
861
|
-
|
|
|
|
862
|
- $list= file_get_contents(ON_LINE.'App.Device.GetGrayUserList'.$limit);
|
|
|
|
863
|
- $array = json_decode($list,TRUE);
|
|
|
|
864
|
- foreach ($array['data']['list'] as $key => $value) {
|
|
|
|
865
|
- switch ($value['type']) {
|
|
|
|
866
|
- case '1':
|
|
|
|
867
|
- $array['data']['list'][$key]['type'] = $facturer[0]['facturer'];
|
|
|
|
868
|
- break;
|
|
|
|
869
|
- case '2':
|
|
|
|
870
|
- $array['data']['list'][$key]['type'] = $facturer[1]['facturer'];
|
|
|
|
871
|
- break;
|
|
|
|
872
|
- case '3':
|
|
|
|
873
|
- $array['data']['list'][$key]['type'] = $facturer[2]['facturer'];
|
|
|
|
874
|
- break;
|
|
|
|
875
|
- case '4':
|
|
|
|
876
|
- $array['data']['list'][$key]['type'] = $facturer[3]['facturer'];
|
|
|
|
877
|
- break;
|
|
|
|
878
|
-
|
|
|
|
879
|
- default:
|
|
|
|
880
|
- $array['data']['list'][$key]['type'] = 'error';
|
|
|
|
881
|
- break;
|
|
|
|
882
|
- }
|
|
|
|
883
|
- }
|
|
|
|
884
|
- return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$array['data']['list'],'count'=>$array['data']['total'],'rel'=>1];
|
|
|
|
885
|
- }
|
|
|
|
886
|
- //获取类型
|
|
|
|
887
|
- $facturer = Db::query("SELECT * FROM `xt-member-two-LINE`.xt_dc_dz_facturer");
|
|
|
|
888
|
- $this->assign ( 'facturer',$facturer);
|
|
|
|
889
|
- $this->assign ( 'title','灰度用户列表');
|
|
|
|
890
|
- return $this->fetch();
|
|
|
|
891
|
- }
|
211
|
+ $where = '';
|
|
|
|
212
|
+ $channel = $data['channel'] ? $data['channel'] : 1;
|
|
892
|
|
213
|
|
|
893
|
- //删除灰度用户
|
|
|
|
894
|
- public function del_gray_user(){
|
|
|
|
895
|
- if(Request::isAjax()){
|
|
|
|
896
|
- $data = Request::except('file');
|
|
|
|
897
|
- $list= file_get_contents(ON_LINE.'App.Device.DelGrayUser&jsstr='.serialize($data['id']));
|
|
|
|
898
|
- $array = json_decode($list,TRUE);
|
214
|
+ $where .= ($channel && $channel==4) ? ' re.type_id in (1,2,3)' : " re.type_id in ($channel)";
|
|
|
|
215
|
+ $where .= $data['key'] ? ' and s.sellername like "%'.$data['key'].'%"' : "";
|
|
899
|
|
216
|
|
|
900
|
- if($array['ret']==200){
|
|
|
|
901
|
- $result['code'] = 1;
|
|
|
|
902
|
- $result['msg'] = 'SUCCESS!';
|
|
|
|
903
|
- }else{
|
|
|
|
904
|
- $result['code'] = 0;
|
|
|
|
905
|
- $result['msg'] = '请刷新页面重新尝试!';
|
|
|
|
906
|
- }
|
|
|
|
907
|
- return $result;
|
|
|
|
908
|
- }
|
|
|
|
909
|
- return view();
|
|
|
|
910
|
- }
|
|
|
|
911
|
-
|
|
|
|
912
|
- //获取在线设备情况
|
|
|
|
913
|
- public function get_device_online_status(){
|
|
|
|
914
|
- //获取类型
|
|
|
|
915
|
- $facturer = Db::query("SELECT * FROM `xt-member-two-LINE`.xt_dc_dz_facturer");
|
|
|
|
916
|
- if(Request::isAjax()){
|
|
|
|
917
|
- $data = Request::except('file');
|
|
|
|
918
|
- $channel = @$data['channel'] ? @$data['channel'] : 1;
|
|
|
|
919
|
- $manufacturer = @$data['manufacturer'] ? @$data['manufacturer'] : 1;
|
|
|
|
920
|
-
|
|
|
|
921
|
- $limit = '&page='.$data["page"].'&size='.$data["limit"].'&sellername='.@$data['key'].'&channel='.$channel.'&type='.$manufacturer;
|
|
|
|
922
|
-
|
|
|
|
923
|
- $list= file_get_contents(ON_LINE.'App.Device.GetDeviceOnlineStatus'.$limit);
|
|
|
|
924
|
- $array = json_decode($list,TRUE);
|
|
|
|
925
|
- foreach ($array['data']['list'] as $key => $value) {
|
|
|
|
926
|
- switch ($value['type']) {
|
|
|
|
927
|
- case '0':
|
|
|
|
928
|
- $array['data']['list'][$key]['type'] = $facturer[0]['facturer'];
|
|
|
|
929
|
- break;
|
|
|
|
930
|
- case '1':
|
|
|
|
931
|
- $array['data']['list'][$key]['type'] = $facturer[0]['facturer'];
|
|
|
|
932
|
- break;
|
|
|
|
933
|
- case '2':
|
|
|
|
934
|
- $array['data']['list'][$key]['type'] = $facturer[1]['facturer'];
|
|
|
|
935
|
- break;
|
|
|
|
936
|
- case '3':
|
|
|
|
937
|
- $array['data']['list'][$key]['type'] = $facturer[2]['facturer'];
|
|
|
|
938
|
- break;
|
|
|
|
939
|
- case '4':
|
|
|
|
940
|
- $array['data']['list'][$key]['type'] = $facturer[3]['facturer'];
|
|
|
|
941
|
- break;
|
|
|
|
942
|
-
|
|
|
|
943
|
- default:
|
|
|
|
944
|
- $array['data']['list'][$key]['type'] = $value['type'];
|
|
|
|
945
|
- break;
|
|
|
|
946
|
- }
|
|
|
|
947
|
- }
|
|
|
|
948
|
- return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$array['data']['list'],'count'=>$array['data']['total'],'rel'=>1];
|
|
|
|
949
|
- }
|
|
|
|
950
|
- $this->assign ( 'facturer',$facturer);
|
|
|
|
951
|
- $this->assign ( 'title','商家话机在线设备列表');
|
|
|
|
952
|
- return $this->fetch();
|
|
|
|
953
|
- }
|
|
|
|
954
|
-
|
|
|
|
955
|
- private function check($aid) {
|
|
|
|
956
|
-
|
|
|
|
957
|
- }
|
|
|
|
958
|
-
|
|
|
|
959
|
- /**
|
|
|
|
960
|
- * 从商家维度统计:订单、短信等情况
|
|
|
|
961
|
- */
|
|
|
|
962
|
- public function GetReserveList(){
|
|
|
|
963
|
- //获取类型
|
|
|
|
964
|
- $facturer = Db::query("SELECT * FROM `xt-member-two-LINE`.xt_dc_dz_facturer");
|
|
|
|
965
|
- if(Request::isAjax()){
|
|
|
|
966
|
- $data = Request::except('file');
|
|
|
|
967
|
- set_time_limit(0);
|
|
|
|
968
|
- $time = $data['time'] ? explode(' - ', $data['time']) : '';
|
|
|
|
969
|
- $data['stime'] = $time ? strtotime(date($time[0],time())) : strtotime(date('Y-m-d 00:00:00',time()));
|
|
|
|
970
|
- $data['etime'] = $time ? strtotime(date($time[1],time())) : strtotime(date('Y-m-d 23:59:59',time()));
|
|
|
|
971
|
-
|
|
|
|
972
|
- $dtime = $data['dtime'] ? explode(' - ', $data['dtime']) : '';
|
|
|
|
973
|
- $data['sdtime'] = $dtime ? strtotime(date($dtime[0],time())) : '';
|
|
|
|
974
|
- $data['edtime'] = $dtime ? strtotime(date($dtime[1],time())) : '';
|
|
|
|
975
|
-
|
|
|
|
976
|
- ////////////////////////////////
|
|
|
|
977
|
- $arr = array();
|
|
|
|
978
|
- $where = '';
|
|
|
|
979
|
-
|
|
|
|
980
|
- $offset = ($data['page']-1)*$data['limit'];
|
|
|
|
981
|
- $limit = " LIMIT $offset,".$data['limit'];
|
|
|
|
982
|
-
|
|
|
|
983
|
- switch ($data['order']) {
|
|
|
|
984
|
- case '1':
|
|
|
|
985
|
- $where .= ' r.type = 1'; # 1 = 顾客下单
|
|
|
|
986
|
- break;
|
|
|
|
987
|
- case '2':
|
|
|
|
988
|
- $where .= ' r.type = 0'; # 0 = 商户下单
|
|
|
|
989
|
- break;
|
|
|
|
990
|
- default:
|
|
|
|
991
|
- $where .= '1=1';
|
|
|
|
992
|
- break;
|
|
|
|
993
|
- }
|
|
|
|
994
|
-
|
|
|
|
995
|
- $data['status'] = $data['status'] ? $data['status'] : 2;
|
|
|
|
996
|
- switch ($data['status']) {
|
|
|
|
997
|
- case 1:
|
|
|
|
998
|
- $where .= ' AND r.status = 0';
|
|
|
|
999
|
- break;
|
|
|
|
1000
|
- case 2:
|
|
|
|
1001
|
- $where .= ' AND r.status = 0';
|
|
|
|
1002
|
- break;
|
|
|
|
1003
|
- case 3:
|
|
|
|
1004
|
- $where .= ' AND r.status = 6';
|
|
|
|
1005
|
- break;
|
|
|
|
1006
|
- case 4:
|
|
|
|
1007
|
- $where .= ' AND r.status = 5';
|
|
|
|
1008
|
- break;
|
|
|
|
1009
|
- case 5:
|
|
|
|
1010
|
- $where .= ' AND r.status = 4';
|
|
|
|
1011
|
- break;
|
|
|
|
1012
|
- case -1:
|
|
|
|
1013
|
- if($data['order']==1){
|
|
|
|
1014
|
- $where .= ' AND r.status in (0,6,5,4)';
|
|
|
|
1015
|
- }else{
|
|
|
|
1016
|
- $where .= ' AND r.status in (0,1,6,5,4)';
|
|
|
|
1017
|
- }
|
|
|
|
1018
|
- break;
|
|
|
|
1019
|
- default:
|
|
|
|
1020
|
- # code...
|
|
|
|
1021
|
- break;
|
|
|
|
1022
|
- }
|
|
|
|
1023
|
-
|
|
|
|
1024
|
- if($data['sdtime'] && $data['edtime']){
|
|
|
|
1025
|
- $where .= $data['status']==2 ? ' AND r.cdate <= UNIX_TIMESTAMP(date_add(NOW(), interval -5 minute)) AND r.ddate BETWEEN '.$data['sdtime'].' AND '.$data['edtime'] : ' AND r.ddate BETWEEN '.$data['sdtime'].' AND '.$data['edtime'];
|
|
|
|
1026
|
- }else{
|
|
|
|
1027
|
- $where .= $data['status']==2 ? ' AND r.cdate <= UNIX_TIMESTAMP(date_add(NOW(), interval -5 minute)) AND r.cdate BETWEEN '.$data['stime'].' AND '.$data['etime'] : ' AND r.cdate BETWEEN '.$data['stime'].' AND '.$data['etime'];
|
|
|
|
1028
|
- }
|
|
|
|
1029
|
-
|
|
|
|
1030
|
- $data['channel'] = $data['channel'] ? implode(',',$data['channel']) : 1;
|
|
|
|
1031
|
-
|
|
|
|
1032
|
- $where .= $data['channel'] == -1 ? '' : ' AND re.type_id in ('.$data['channel'].')';
|
|
|
|
1033
|
- #key
|
|
|
|
1034
|
- $where .= $data['key'] ? ' AND s.sellername like "%'.$data['key'].'%"' : ''; //商家名称
|
|
|
|
1035
|
- #ID
|
|
|
|
1036
|
- $where .= $data['nokey'] ? ' AND r.id ='.$data['nokey'] : ''; //商家ID
|
|
|
|
1037
|
-
|
|
|
|
1038
|
-
|
|
|
|
1039
|
- $offset = ($data['page']-1)*$data['limit'];
|
217
|
+ $offset = ($data["page"] - 1) * $data["limit"];
|
|
1040
|
$limit = " LIMIT $offset,".$data['limit'];
|
218
|
$limit = " LIMIT $offset,".$data['limit'];
|
|
1041
|
|
219
|
|
|
1042
|
-
|
|
|
|
1043
|
- //导出操作
|
|
|
|
1044
|
- if($data['export']){
|
|
|
|
1045
|
- $limit = "";
|
|
|
|
1046
|
- }else{
|
|
|
|
1047
|
- $limit = " LIMIT $offset,".$data['limit'];
|
|
|
|
1048
|
- }
|
|
|
|
1049
|
-
|
|
|
|
1050
|
- $admin = db('admin')->where(array('admin_id'=>session('aid')))->find();
|
|
|
|
1051
|
-
|
|
|
|
1052
|
- //当前用户分组为代理商时 获取代理商下面的数据
|
|
|
|
1053
|
- if(in_array($admin['group_id'],array(8))) {
|
|
|
|
1054
|
- //查询账号对应的区域ID
|
|
|
|
1055
|
- $account = Db::query("SELECT
|
|
|
|
1056
|
- *
|
|
|
|
1057
|
- FROM
|
|
|
|
1058
|
- `xt-member-two-LINE`.xt_dc_dz_agent_account
|
|
|
|
1059
|
- WHERE
|
|
|
|
1060
|
- account = '".$admin['username']."'");
|
|
|
|
1061
|
-
|
|
|
|
1062
|
- $where .= ' AND ags.areaid = '.$account[0]['areaid']; //区域ID
|
|
|
|
1063
|
-
|
|
|
|
1064
|
- //检测是否为代理商
|
|
|
|
1065
|
- $rs = Db::query("SELECT
|
|
|
|
1066
|
- dv.type,
|
|
|
|
1067
|
- r.tid,
|
|
|
|
1068
|
- r.tableinfo,
|
|
|
|
1069
|
- r.id,
|
|
|
|
1070
|
- r.rname,
|
|
|
|
1071
|
- r.sex,
|
|
|
|
1072
|
- r.pnum,
|
|
|
|
1073
|
- r.phone,
|
|
|
|
1074
|
- r.cusdem,
|
|
|
|
1075
|
- r.ddate,
|
|
|
|
1076
|
- r.cdate,
|
|
|
|
1077
|
- r.status,
|
|
|
|
1078
|
- r.ddate_solt,
|
|
|
|
1079
|
- r.room_demand,
|
|
|
|
1080
|
- r.operator_openid,
|
|
|
|
1081
|
- s.sellername,
|
|
|
|
1082
|
- s.is_tele,
|
|
|
|
1083
|
- s.seller_tel
|
|
|
|
1084
|
- FROM
|
|
|
|
1085
|
- `xt-member-two-LINE`.xt_dc_reserve AS r
|
|
|
|
1086
|
- LEFT JOIN `xt-member-two-LINE`.xt_seller AS s ON r.sid = s.id
|
|
|
|
1087
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_type_rel AS re ON re.sid = r.sid
|
|
|
|
1088
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_app_dv AS dv ON dv.sid = s.id
|
|
|
|
1089
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_agent_seller AS ags on ags.sellerid = s.id
|
|
|
|
1090
|
- WHERE
|
|
|
|
1091
|
- $where
|
|
|
|
1092
|
- GROUP BY
|
|
|
|
1093
|
- r.id".$limit);
|
|
|
|
1094
|
-
|
|
|
|
1095
|
- $total = Db::query("SELECT
|
|
|
|
1096
|
- r.id
|
|
|
|
1097
|
- FROM
|
|
|
|
1098
|
- `xt-member-two-LINE`.xt_dc_reserve AS r
|
|
|
|
1099
|
- LEFT JOIN `xt-member-two-LINE`.xt_seller AS s ON r.sid = s.id
|
|
|
|
1100
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_type_rel AS re ON re.sid = r.sid
|
|
|
|
1101
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_app_dv AS dv ON dv.sid = s.id
|
|
|
|
1102
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_agent_seller AS ags on ags.sellerid = s.id
|
|
|
|
1103
|
- WHERE
|
|
|
|
1104
|
- $where
|
|
|
|
1105
|
- GROUP BY
|
|
|
|
1106
|
- r.id");
|
|
|
|
1107
|
- }else{
|
|
|
|
1108
|
- //检测是否为代理商
|
|
|
|
1109
|
- $rs = Db::query("SELECT
|
|
|
|
1110
|
- dv.type,
|
|
|
|
1111
|
- r.tid,
|
|
|
|
1112
|
- r.tableinfo,
|
|
|
|
1113
|
- r.id,
|
|
|
|
1114
|
- r.rname,
|
|
|
|
1115
|
- r.sex,
|
|
|
|
1116
|
- r.pnum,
|
|
|
|
1117
|
- r.phone,
|
|
|
|
1118
|
- r.cusdem,
|
|
|
|
1119
|
- r.ddate,
|
|
|
|
1120
|
- r.cdate,
|
|
|
|
1121
|
- r.status,
|
|
|
|
1122
|
- r.ddate_solt,
|
|
|
|
1123
|
- r.room_demand,
|
|
|
|
1124
|
- r.operator_openid,
|
|
|
|
1125
|
- s.sellername,
|
|
|
|
1126
|
- s.is_tele,
|
|
|
|
1127
|
- s.seller_tel
|
|
|
|
1128
|
- FROM
|
|
|
|
1129
|
- `xt-member-two-LINE`.xt_dc_reserve AS r
|
|
|
|
1130
|
- LEFT JOIN `xt-member-two-LINE`.xt_seller AS s ON r.sid = s.id
|
|
|
|
1131
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_type_rel AS re ON re.sid = r.sid
|
|
|
|
1132
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_app_dv AS dv ON dv.sid = s.id
|
|
|
|
1133
|
- WHERE
|
|
|
|
1134
|
- $where
|
|
|
|
1135
|
- GROUP BY
|
|
|
|
1136
|
- r.id".$limit);
|
|
|
|
1137
|
-
|
|
|
|
1138
|
- $total = Db::query("SELECT
|
|
|
|
1139
|
- r.id
|
|
|
|
1140
|
- FROM
|
|
|
|
1141
|
- `xt-member-two-LINE`.xt_dc_reserve AS r
|
|
|
|
1142
|
- LEFT JOIN `xt-member-two-LINE`.xt_seller AS s ON r.sid = s.id
|
|
|
|
1143
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_type_rel AS re ON re.sid = r.sid
|
|
|
|
1144
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_app_dv AS dv ON dv.sid = s.id
|
|
|
|
1145
|
- WHERE
|
|
|
|
1146
|
- $where
|
|
|
|
1147
|
- GROUP BY
|
|
|
|
1148
|
- r.id");
|
|
|
|
1149
|
- }
|
|
|
|
1150
|
-
|
|
|
|
1151
|
- foreach ($rs as $key => $value) {
|
|
|
|
1152
|
- $rs[$key]['seller_tel'] = str_replace(',', '、', $value['seller_tel']);
|
|
|
|
1153
|
- $message_time = Db::query("SELECT
|
|
|
|
1154
|
- handle_time,rec_date
|
220
|
+ //卡券信息
|
|
|
|
221
|
+ $rs = Db::query("SELECT
|
|
|
|
222
|
+ s.*
|
|
1155
|
FROM
|
223
|
FROM
|
|
1156
|
- `xt-member-two-LINE`.xt_dc_dz_message
|
224
|
+ `xt-member-two-LINE`.xt_dc_dz_card_info AS s
|
|
|
|
225
|
+ LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_type_rel AS re ON re.sid = s.id
|
|
1157
|
WHERE
|
226
|
WHERE
|
|
1158
|
- rid = ".$value['id']." and message_type = 10");
|
|
|
|
1159
|
- $rs[$key]['handle_time'] = $message_time[0]['handle_time'];
|
|
|
|
1160
|
- $rs[$key]['rec_date'] = $message_time[0]['rec_date'];
|
|
|
|
1161
|
- }
|
|
|
|
1162
|
-
|
|
|
|
1163
|
- $arr['list'] = $rs;
|
|
|
|
1164
|
- $arr['total'] = count($total);
|
|
|
|
1165
|
- ////////////////////////////////
|
|
|
|
1166
|
-
|
|
|
|
1167
|
- foreach ($arr['list'] as $key => $value) {
|
|
|
|
1168
|
- //已分配的订单显示 分配的桌位
|
|
|
|
1169
|
- if($value['status']==5){
|
|
|
|
1170
|
- $arr['list'][$key]['tid'] = explode(',',@$value['tid']);
|
|
|
|
1171
|
- }
|
|
|
|
1172
|
- //有无设备
|
|
|
|
1173
|
- if($value['is_tele']==1){
|
|
|
|
1174
|
- switch ($value['type']) {
|
|
|
|
1175
|
- case '1':
|
|
|
|
1176
|
- $arr['list'][$key]['dv'] = $facturer[0]['facturer'];
|
|
|
|
1177
|
- break;
|
|
|
|
1178
|
- case '2':
|
|
|
|
1179
|
- $arr['list'][$key]['dv'] = $facturer[1]['facturer'];
|
|
|
|
1180
|
- break;
|
|
|
|
1181
|
- case '3':
|
|
|
|
1182
|
- $arr['list'][$key]['dv'] = $facturer[2]['facturer'];
|
|
|
|
1183
|
- break;
|
|
|
|
1184
|
- case '4':
|
|
|
|
1185
|
- $arr['list'][$key]['dv'] = $facturer[3]['facturer'];
|
|
|
|
1186
|
- break;
|
|
|
|
1187
|
- default:
|
|
|
|
1188
|
- $arr['list'][$key]['dv'] = '无';
|
|
|
|
1189
|
- break;
|
|
|
|
1190
|
- }
|
|
|
|
1191
|
- }else{
|
|
|
|
1192
|
- $arr['list'][$key]['dv'] = '无';
|
|
|
|
1193
|
- }
|
|
|
|
1194
|
- //订单接受时间段
|
|
|
|
1195
|
- switch ($value['ddate_solt']) {
|
|
|
|
1196
|
- //'未设置/早市/午市/晚市/夜宵 0/1/2/3/4',
|
|
|
|
1197
|
- case 0:
|
|
|
|
1198
|
- $value['ddate_solt'] = '未设置';
|
|
|
|
1199
|
- break;
|
|
|
|
1200
|
- case 1:
|
|
|
|
1201
|
- $value['ddate_solt'] = '早市';
|
|
|
|
1202
|
- break;
|
|
|
|
1203
|
- case 2:
|
|
|
|
1204
|
- $value['ddate_solt'] = '午市';
|
|
|
|
1205
|
- break;
|
|
|
|
1206
|
- case 3:
|
|
|
|
1207
|
- $value['ddate_solt'] = '晚市';
|
|
|
|
1208
|
- break;
|
|
|
|
1209
|
- case 4:
|
|
|
|
1210
|
- $value['ddate_solt'] = '夜宵';
|
|
|
|
1211
|
- break;
|
|
|
|
1212
|
- default:
|
|
|
|
1213
|
- # code...
|
|
|
|
1214
|
- break;
|
|
|
|
1215
|
- }
|
|
|
|
1216
|
- $arr['list'][$key]['ddate'] = date('Y-m-d H:i:s',$value['ddate']).'['.$value['ddate_solt'].']';
|
|
|
|
1217
|
- $arr['list'][$key]['cdate'] = date('Y-m-d H:i:s',$value['cdate']);
|
|
|
|
1218
|
- $arr['list'][$key]['handle_time'] = $value['handle_time'] ? date('Y-m-d H:i:s',$value['handle_time']) : '';
|
|
|
|
1219
|
- $arr['list'][$key]['rec_date'] = $value['rec_date'] ? date('Y-m-d H:i:s',$value['rec_date']) : '';
|
|
|
|
1220
|
- switch ($value['status']) {
|
|
|
|
1221
|
- case 0:
|
|
|
|
1222
|
- $arr['list'][$key]['sta'] = '待确认';
|
|
|
|
1223
|
- break;
|
|
|
|
1224
|
- case 1:
|
|
|
|
1225
|
- $arr['list'][$key]['sta'] = '已定座';
|
|
|
|
1226
|
- break;
|
|
|
|
1227
|
- case 2:
|
|
|
|
1228
|
- $arr['list'][$key]['sta'] = '到店';
|
|
|
|
1229
|
- break;
|
|
|
|
1230
|
- case 3:
|
|
|
|
1231
|
- $arr['list'][$key]['sta'] = '离店';
|
|
|
|
1232
|
- break;
|
|
|
|
1233
|
- case 4:
|
|
|
|
1234
|
- $arr['list'][$key]['sta'] = '已取消';
|
|
|
|
1235
|
- break;
|
|
|
|
1236
|
- case 5:
|
|
|
|
1237
|
- $arr['list'][$key]['sta'] = '已分配';
|
|
|
|
1238
|
- break;
|
|
|
|
1239
|
- case 6:
|
|
|
|
1240
|
- $arr['list'][$key]['sta'] = '拒单';
|
|
|
|
1241
|
- break;
|
|
|
|
1242
|
- default:
|
|
|
|
1243
|
- # code...
|
|
|
|
1244
|
- break;
|
|
|
|
1245
|
- }
|
|
|
|
1246
|
- switch ($value['sex']) {
|
|
|
|
1247
|
- case 1:
|
|
|
|
1248
|
- $arr['list'][$key]['rname'] = $value['rname'].'先生'.'('.$value['phone'].')';
|
|
|
|
1249
|
- break;
|
|
|
|
1250
|
- case 2:
|
|
|
|
1251
|
- $arr['list'][$key]['rname'] = $value['rname'].'女士'.'('.$value['phone'].')';
|
|
|
|
1252
|
- break;
|
|
|
|
1253
|
- case 3:
|
|
|
|
1254
|
- $arr['list'][$key]['rname'] = $value['rname'].'公司'.'('.$value['phone'].')';
|
|
|
|
1255
|
- break;
|
|
|
|
1256
|
- default:
|
|
|
|
1257
|
- # code...
|
|
|
|
1258
|
- break;
|
|
|
|
1259
|
- }
|
|
|
|
1260
|
-
|
|
|
|
1261
|
- if($value['room_demand']){
|
|
|
|
1262
|
- $arr['list'][$key]['room_demand'] = implode('、',array_column(json_decode($value['room_demand'],true), 'name'));
|
|
|
|
1263
|
- }
|
|
|
|
1264
|
-
|
|
|
|
1265
|
- $arr['list'][$key]['sta'] = $value['is_tele']==1 ? $arr['list'][$key]['sta'] : $arr['list'][$key]['sta'].'无话机';
|
|
|
|
1266
|
-
|
|
|
|
1267
|
- //根据操作人识别操作终端
|
|
|
|
1268
|
- if(isset($template['operator_openid'])){
|
|
|
|
1269
|
- if(strstr($template['operator_openid'],'_',-4)=='tele'){ //话机操作
|
|
|
|
1270
|
- $arr['list'][$key]['operator_openid'] = '电话机';
|
|
|
|
1271
|
- }
|
|
|
|
1272
|
-
|
|
|
|
1273
|
- if(strstr($template['operator_openid'],'_',-4)=='wind'){ //PC操作
|
|
|
|
1274
|
- $arr['list'][$key]['operator_openid'] = 'PC';
|
|
|
|
1275
|
- }
|
|
|
|
1276
|
-
|
|
|
|
1277
|
- if(strstr($template['operator_openid'],'_',-4)=='chat'){ //PC操作
|
|
|
|
1278
|
- $arr['list'][$key]['operator_openid'] = '小程序';
|
|
|
|
1279
|
- }
|
|
|
|
1280
|
- }
|
|
|
|
1281
|
- }
|
|
|
|
1282
|
- foreach ($arr['list'] as $key => $value) {
|
|
|
|
1283
|
- $arr['list'][$key]['tablename'] = '';
|
|
|
|
1284
|
- //如果存了桌子的信息则,直接返回桌子信息,否则去桌位表查
|
|
|
|
1285
|
- if($value['tableinfo']!=NULL){
|
|
|
|
1286
|
- $tableArr = json_decode($value['tableinfo'],true);
|
|
|
|
1287
|
- if(is_array($tableArr)){
|
|
|
|
1288
|
- foreach ($tableArr as $tkey => $tvalue) {
|
|
|
|
1289
|
- $arr['list'][$key]['tablename'] .= $tvalue['name'].'、';
|
|
|
|
1290
|
- }
|
|
|
|
1291
|
- }
|
|
|
|
1292
|
- }
|
|
|
|
1293
|
- /**else{
|
|
|
|
1294
|
- foreach ($value['tid'] as $k => $v) {
|
|
|
|
1295
|
- //$rs[$key]['name'][] = Db::query("SELECT name FROM `xt-member-two-LINE`.xt_dc_seller_table where id = ".$v);
|
|
|
|
1296
|
- }
|
|
|
|
1297
|
- }**/
|
|
|
|
1298
|
- }
|
|
|
|
1299
|
-
|
|
|
|
1300
|
- //excel 导出
|
|
|
|
1301
|
- if($data['export']){
|
|
|
|
1302
|
- return $result = [
|
|
|
|
1303
|
- 'code'=>0,'msg'=>'获取成功!',
|
|
|
|
1304
|
- 'data'=>$arr['list'],
|
|
|
|
1305
|
- 'count'=>$arr['total'],
|
|
|
|
1306
|
- 'rel'=>1
|
|
|
|
1307
|
- ];
|
|
|
|
1308
|
- //加载PHPExcle类库
|
|
|
|
1309
|
- $DOCUMENT_ROOT = str_replace('public','',$_SERVER['DOCUMENT_ROOT']);
|
|
|
|
1310
|
- require_once $DOCUMENT_ROOT.'vendor/Classes/PHPExcel.php';
|
|
|
|
1311
|
- require_once $DOCUMENT_ROOT.'vendor/Classes/PHPExcel/IOFactory.php';
|
|
|
|
1312
|
-
|
|
|
|
1313
|
- //实例化PHPExcel类
|
|
|
|
1314
|
- $objPHPExcel = new \PHPExcel();
|
|
|
|
1315
|
- //激活当前的sheet表
|
|
|
|
1316
|
- $objPHPExcel->setActiveSheetIndex(0);
|
|
|
|
1317
|
- //设置表格头(即excel表格的第一行)
|
|
|
|
1318
|
- $objPHPExcel->setActiveSheetIndex(0)
|
|
|
|
1319
|
- ->setCellValue('A1', '订单编号')
|
|
|
|
1320
|
- ->setCellValue('B1', '所属商家')
|
|
|
|
1321
|
- ->setCellValue('C1', '商家电话')
|
|
|
|
1322
|
- ->setCellValue('D1', '到店时间')
|
|
|
|
1323
|
- ->setCellValue('E1', '包间名称')
|
|
|
|
1324
|
- ->setCellValue('F1', '包间需求')
|
|
|
|
1325
|
- ->setCellValue('G1', '客户信息')
|
|
|
|
1326
|
- ->setCellValue('H1', '备注')
|
|
|
|
1327
|
- ->setCellValue('I1', '下单时间')
|
|
|
|
1328
|
- ->setCellValue('J1', '商家设备')
|
|
|
|
1329
|
- ->setCellValue('K1', '消息送达时间')
|
|
|
|
1330
|
- ->setCellValue('L1', '处理时间')
|
|
|
|
1331
|
- ->setCellValue('M1', '状态');
|
|
|
|
1332
|
- //设置A列水平居中
|
|
|
|
1333
|
- $objPHPExcel->setActiveSheetIndex(0)->getStyle('A1')->getAlignment()
|
|
|
|
1334
|
- ->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
|
1335
|
- //设置单元格宽度
|
|
|
|
1336
|
- //循环刚取出来的数组,将数据逐一添加到excel表格。
|
|
|
|
1337
|
- $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('B')->setWidth(10);
|
|
|
|
1338
|
- $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('C')->setWidth(20);
|
|
|
|
1339
|
- $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('E')->setWidth(20);
|
|
|
|
1340
|
- $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('F')->setWidth(30);
|
|
|
|
1341
|
-
|
|
|
|
1342
|
- for($i=0;$i<count($arr['list']);$i++){
|
|
|
|
1343
|
- $objPHPExcel->getActiveSheet()->setCellValue('A'.($i+2),$list[$i]['id']);//订单编号
|
|
|
|
1344
|
- $objPHPExcel->getActiveSheet()->setCellValue('B'.($i+2),$list[$i]['sellername']);//所属商家
|
|
|
|
1345
|
- $objPHPExcel->getActiveSheet()->setCellValue('C'.($i+2),$list[$i]['seller_tel']);//商家电话
|
|
|
|
1346
|
- $objPHPExcel->getActiveSheet()->setCellValue('D'.($i+2),$list[$i]['ddate']);//到店时间
|
|
|
|
1347
|
- $objPHPExcel->getActiveSheet()->setCellValue('E'.($i+2),$list[$i]['tablename']);//包间名称
|
|
|
|
1348
|
- $objPHPExcel->getActiveSheet()->setCellValue('F'.($i+2),$list[$i]['room_demand']);//包间需求
|
|
|
|
1349
|
- $objPHPExcel->getActiveSheet()->setCellValue('G'.($i+2),$list[$i]['rname']);//客户信息
|
|
|
|
1350
|
- $objPHPExcel->getActiveSheet()->setCellValue('H'.($i+2),$list[$i]['cusdem']);//备注
|
|
|
|
1351
|
- $objPHPExcel->getActiveSheet()->setCellValue('I'.($i+2),$list[$i]['cdate']);//下单时间
|
|
|
|
1352
|
- $objPHPExcel->getActiveSheet()->setCellValue('J'.($i+2),$list[$i]['dv']);//商家设备
|
|
|
|
1353
|
- $objPHPExcel->getActiveSheet()->setCellValue('K'.($i+2),$list[$i]['rec_date']);//消息送达时间
|
|
|
|
1354
|
- $objPHPExcel->getActiveSheet()->setCellValue('L'.($i+2),$list[$i]['handle_time']);//处理时间
|
|
|
|
1355
|
- $objPHPExcel->getActiveSheet()->setCellValue('M'.($i+2),$list[$i]['sta']);//状态
|
|
|
|
1356
|
- }
|
|
|
|
1357
|
- //设置保存的Excel表格名称
|
|
|
|
1358
|
- $filename = '预定订单数据'.date('ymd',time()).'.xls';
|
|
|
|
1359
|
- //8.设置当前激活的sheet表格名称;
|
|
|
|
1360
|
- $objPHPExcel->getActiveSheet()->setTitle('订单内容');
|
|
|
|
1361
|
- //设置浏览器窗口下载表格
|
|
|
|
1362
|
- header("Content-Type: application/force-download");
|
|
|
|
1363
|
- header("Content-Type: application/octet-stream");
|
|
|
|
1364
|
- header("Content-Type: application/download");
|
|
|
|
1365
|
- header('Content-Disposition:inline;filename="'.$filename.'"');
|
|
|
|
1366
|
- header("Pragma: no-cache");
|
|
|
|
1367
|
- //生成excel文件
|
|
|
|
1368
|
- $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
|
|
|
|
1369
|
- //下载文件在浏览器窗口
|
|
|
|
1370
|
- $objWriter->save('php://output');
|
|
|
|
1371
|
- exit;
|
|
|
|
1372
|
- }
|
|
|
|
1373
|
- //print_r($arr['list']);die;
|
|
|
|
1374
|
- return $result = [
|
|
|
|
1375
|
- 'code'=>0,'msg'=>'获取成功!',
|
|
|
|
1376
|
- 'data'=>$arr['list'],
|
|
|
|
1377
|
- 'count'=>$arr['total'],
|
|
|
|
1378
|
- 'rel'=>1
|
|
|
|
1379
|
- ];
|
|
|
|
1380
|
- }
|
|
|
|
1381
|
- $this->assign ( 'title','订单管理');
|
|
|
|
1382
|
- return $this->fetch();
|
|
|
|
1383
|
- }
|
|
|
|
1384
|
-
|
|
|
|
1385
|
- /**
|
|
|
|
1386
|
- * 商家详情
|
|
|
|
1387
|
- */
|
|
|
|
1388
|
- public function reservedetail(){
|
|
|
|
1389
|
- $data = Request::except('file');
|
|
|
|
1390
|
- $rs = Db::query("SELECT * FROM `xt-member-two-LINE`.xt_dc_dz_cancel where up_rid = ".$data['rid']." order by cdate desc");
|
|
|
|
1391
|
- if($rs){
|
227
|
+ ".$where." order by s.sid".$limit);
|
|
|
|
228
|
+ //格式化数据
|
|
1392
|
foreach ($rs as $key => $value) {
|
229
|
foreach ($rs as $key => $value) {
|
|
1393
|
- if($this->isjson_str($value['desc'])){
|
|
|
|
1394
|
- $rs[$key]['desc'] = "diff";
|
|
|
|
1395
|
- }
|
|
|
|
1396
|
- switch ($value['action_type']) {
|
230
|
+ $rs[$key]['create_time'] = date("Y年m月d日",$value['create_time']);
|
|
|
|
231
|
+ switch ($value['status']) {
|
|
1397
|
case '1':
|
232
|
case '1':
|
|
1398
|
- $rs[$key]['action_type'] = '取消预定';
|
233
|
+ $rs[$key]['status_msg'] = '已投放';
|
|
1399
|
break;
|
234
|
break;
|
|
1400
|
case '2':
|
235
|
case '2':
|
|
1401
|
- $rs[$key]['action_type'] = '修改预定';
|
236
|
+ $rs[$key]['status_msg'] = '未投放';
|
|
1402
|
break;
|
237
|
break;
|
|
1403
|
case '3':
|
238
|
case '3':
|
|
1404
|
- $rs[$key]['action_type'] = '变更客户经理';
|
|
|
|
1405
|
- break;
|
|
|
|
1406
|
- case '4':
|
|
|
|
1407
|
- $rs[$key]['action_type'] = '确认用户到店';
|
|
|
|
1408
|
- break;
|
|
|
|
1409
|
- case '5':
|
|
|
|
1410
|
- $rs[$key]['action_type'] = '分配包间';
|
|
|
|
1411
|
- break;
|
|
|
|
1412
|
- case '6':
|
|
|
|
1413
|
- $rs[$key]['action_type'] = '拒绝接单';
|
239
|
+ $rs[$key]['status_msg'] = '停止投放';
|
|
1414
|
break;
|
240
|
break;
|
|
1415
|
default:
|
241
|
default:
|
|
1416
|
# code...
|
242
|
# code...
|
|
1417
|
break;
|
243
|
break;
|
|
1418
|
}
|
244
|
}
|
|
1419
|
- $rs[$key]['cdate'] = date("Y年m月d日 H时i分",$value['cdate']);
|
|
|
|
1420
|
}
|
245
|
}
|
|
|
|
246
|
+
|
|
|
|
247
|
+ //获取总条数
|
|
|
|
248
|
+ $total = Db::query("SELECT
|
|
|
|
249
|
+ s.id
|
|
|
|
250
|
+ FROM
|
|
|
|
251
|
+ `xt-member-two-LINE`.xt_dc_dz_card_info AS s
|
|
|
|
252
|
+ LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_type_rel AS re ON re.sid = s.id
|
|
|
|
253
|
+ WHERE
|
|
|
|
254
|
+ ".$where."");
|
|
|
|
255
|
+ return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$rs,'count'=>count($total),'rel'=>1];
|
|
1421
|
}
|
256
|
}
|
|
1422
|
- //订单详情
|
|
|
|
1423
|
- $detail = Db::query("SELECT
|
|
|
|
1424
|
- r.*,
|
|
|
|
1425
|
- s.sellername
|
|
|
|
1426
|
- FROM
|
|
|
|
1427
|
- `xt-member-two-LINE`.xt_dc_reserve AS r
|
|
|
|
1428
|
- LEFT JOIN `xt-member-two-LINE`.xt_seller AS s ON r.sid = s.id
|
|
|
|
1429
|
- WHERE
|
|
|
|
1430
|
- r.id = ".$data['rid']);
|
|
|
|
1431
|
- switch ($detail[0]['channel']) {
|
|
|
|
1432
|
- case 1:
|
|
|
|
1433
|
- $detail[0]['channel'] = '微信小程序';
|
|
|
|
1434
|
- break;
|
|
|
|
1435
|
- case 2:
|
|
|
|
1436
|
- $detail[0]['channel'] = '电话机';
|
|
|
|
1437
|
- break;
|
|
|
|
1438
|
- case 3:
|
|
|
|
1439
|
- $detail[0]['channel'] = '安卓手机客户端';
|
|
|
|
1440
|
- break;
|
|
|
|
1441
|
- case 4:
|
|
|
|
1442
|
- $detail[0]['channel'] = 'C端';
|
|
|
|
1443
|
- break;
|
|
|
|
1444
|
- default:
|
|
|
|
1445
|
- # code...
|
|
|
|
1446
|
- break;
|
|
|
|
1447
|
- }
|
|
|
|
1448
|
- switch ($detail[0]['sex']) {
|
|
|
|
1449
|
- case 1:
|
|
|
|
1450
|
- $detail[0]['sex'] = '先生';
|
|
|
|
1451
|
- break;
|
|
|
|
1452
|
- case 2:
|
|
|
|
1453
|
- $detail[0]['sex'] = '女士';
|
|
|
|
1454
|
- break;
|
|
|
|
1455
|
- case 3:
|
|
|
|
1456
|
- $detail[0]['sex'] = '公司';
|
|
|
|
1457
|
- break;
|
|
|
|
1458
|
- default:
|
|
|
|
1459
|
- # code...
|
|
|
|
1460
|
- break;
|
|
|
|
1461
|
- }
|
|
|
|
1462
|
- $this->assign ( 'html',$detail[0]);
|
|
|
|
1463
|
- $this->assign ( 'rid',$data['rid']);
|
|
|
|
1464
|
- $this->assign ( 'data',$rs);
|
|
|
|
1465
|
- $this->assign ( 'title','订单操作日志详情');
|
257
|
+ $this->assign ( 'title','商家卡券');
|
|
1466
|
return $this->fetch();
|
258
|
return $this->fetch();
|
|
1467
|
}
|
259
|
}
|
|
1468
|
|
260
|
|
|
1469
|
- public function isjson_str($data='',$assoc = false){
|
|
|
|
1470
|
- $data = json_decode($data,$assoc);
|
|
|
|
1471
|
- if(($data&&is_object($data))||(is_array($data)&&!empty($data))){
|
|
|
|
1472
|
- return true;
|
|
|
|
1473
|
- }
|
|
|
|
1474
|
- return false;
|
|
|
|
1475
|
- }
|
|
|
|
1476
|
/**
|
261
|
/**
|
|
1477
|
- * 状态设置
|
262
|
+ * 商家卡券-卡券投放- 停止投放
|
|
1478
|
*/
|
263
|
*/
|
|
1479
|
- public function setReserveStatus(){
|
|
|
|
1480
|
-
|
264
|
+ public function cardstop(){
|
|
1481
|
if(Request::isAjax()){
|
265
|
if(Request::isAjax()){
|
|
1482
|
$data = Request::except('file');
|
266
|
$data = Request::except('file');
|
|
1483
|
-
|
|
|
|
1484
|
- $data['cause'] = json_encode(array('uid'=>-1,'uname'=>session('username'),'desc'=>$data['cause']));
|
|
|
|
1485
|
-
|
|
|
|
1486
|
- $list= file_get_contents(ON_LINE.'App.Reserve.SetReserveStatus&rid='.$data['id'].'&status='.$data['status'].'&cause='.$data['cause']);
|
|
|
|
1487
|
-
|
|
|
|
1488
|
- $array = json_decode($list,TRUE);
|
|
|
|
1489
|
- if($array['ret']==200){
|
267
|
+ $ups = Db::query("UPDATE `xt-member-two-LINE`.xt_dc_dz_card_info set status = 3 where id = ".$data['id']);
|
|
|
|
268
|
+ if(!$ups){
|
|
1490
|
$result['code'] = 1;
|
269
|
$result['code'] = 1;
|
|
1491
|
- $result['msg'] = 'SUCCESS!';
|
270
|
+ $result['msg'] = '该卡券已停止投放!';
|
|
1492
|
}else{
|
271
|
}else{
|
|
1493
|
$result['code'] = 0;
|
272
|
$result['code'] = 0;
|
|
1494
|
- $result['msg'] = '请求错误!';
|
273
|
+ $result['msg'] = '请求错误,请联系管理员!';
|
|
1495
|
}
|
274
|
}
|
|
1496
|
return $result;
|
275
|
return $result;
|
|
1497
|
}
|
276
|
}
|
|
@@ -1499,175 +278,67 @@ class Card extends Common |
|
@@ -1499,175 +278,67 @@ class Card extends Common |
|
1499
|
}
|
278
|
}
|
|
1500
|
|
279
|
|
|
1501
|
/**
|
280
|
/**
|
|
1502
|
- * 状态设置
|
281
|
+ * 商家卡券-卡券投放- 投放-弹层
|
|
1503
|
*/
|
282
|
*/
|
|
1504
|
- public function devicelists(){
|
|
|
|
1505
|
- $facturer = Db::query("SELECT * FROM `xt-member-two-LINE`.xt_dc_dz_facturer");
|
|
|
|
1506
|
- $this->assign ( 'facturer',$facturer);
|
|
|
|
1507
|
- if(Request::isAjax()){
|
|
|
|
1508
|
- $data = Request::except('file');
|
|
|
|
1509
|
- $channel = @$data['channel'] ? @$data['channel'] : 1;
|
|
|
|
1510
|
- $manufacturer = @$data['manufacturer'] ? @$data['manufacturer'] : 1;
|
|
|
|
1511
|
-
|
283
|
+ public function cardputin(){
|
|
|
|
284
|
+ $id = Request::except('file');
|
|
|
|
285
|
+ if(request()->isPost()){
|
|
|
|
286
|
+ $data = input('post.');
|
|
1512
|
|
287
|
|
|
1513
|
- $page = ($data['page']-1)*$data['limit'];
|
288
|
+ //商家基本数据
|
|
|
|
289
|
+ $end_time = Db::query("SELECT
|
|
|
|
290
|
+ end_time
|
|
|
|
291
|
+ FROM
|
|
|
|
292
|
+ `xt-member-two-LINE`.xt_dc_dz_card_info
|
|
|
|
293
|
+ WHERE id=".$data['cid']);
|
|
1514
|
|
294
|
|
|
1515
|
- $__Where = ' 1=1';
|
295
|
+ $arr = [];
|
|
|
|
296
|
+ $time = $data['date'] ? explode(' - ', $data['date']) : '';
|
|
|
|
297
|
+ $arr['receive_start_time'] = $time ? strtotime(date($time[0],time())) : '';
|
|
|
|
298
|
+ $arr['receive_end_time'] = $time ? strtotime(date($time[1],time())) : '';
|
|
|
|
299
|
+ $arr['total_limit'] = $data['total_limit']=='on' ? 1 : 0;
|
|
|
|
300
|
+ $arr['total'] = $data['total'] ? intval($data['total']) : 0;
|
|
|
|
301
|
+ $arr['receive_condition'] = $data['receive_condition'] ? intval($data['receive_condition']) : 0;
|
|
|
|
302
|
+ $arr['order_price'] = $data['order_price'] ? $data['order_price'] : 0;
|
|
|
|
303
|
+ $arr['contributor'] = $_SESSION['think']['username'];
|
|
|
|
304
|
+ $arr['contributor_time'] = time();
|
|
|
|
305
|
+ $arr['status'] = 1;
|
|
1516
|
|
306
|
|
|
1517
|
- $__Where .= @$data['key'] ? " and s.sellername like '%".$data['key']."%'" : "";
|
|
|
|
1518
|
|
307
|
|
|
1519
|
- switch ($manufacturer) {
|
|
|
|
1520
|
- case '1':
|
|
|
|
1521
|
- $__Where .= ' and sta.type in (0,1)';
|
|
|
|
1522
|
- break;
|
|
|
|
1523
|
- case '-1':
|
|
|
|
1524
|
- $__Where .= ' ';
|
|
|
|
1525
|
- break;
|
|
|
|
1526
|
- default:
|
|
|
|
1527
|
- $__Where .= ' and sta.type = '.$manufacturer;
|
|
|
|
1528
|
- break;
|
|
|
|
1529
|
- }
|
|
|
|
1530
|
-
|
|
|
|
1531
|
- if($channel && $channel!=-1) {
|
|
|
|
1532
|
- $__Where .= ' and rel.type_id='. $channel;
|
|
|
|
1533
|
- }else{
|
|
|
|
1534
|
- $__Where .= "";
|
308
|
+ if($end_time[0]['end_time'] < $arr['receive_end_time']){
|
|
|
|
309
|
+ $result['code'] = 0;
|
|
|
|
310
|
+ $result['msg'] = '领取期限必须在卡券有效期内!';
|
|
|
|
311
|
+ return $result;
|
|
1535
|
}
|
312
|
}
|
|
1536
|
|
313
|
|
|
1537
|
- $total = Db::query("SELECT
|
|
|
|
1538
|
- count(1) as total
|
|
|
|
1539
|
- FROM
|
|
|
|
1540
|
- `xt-member-two-LINE`.xt_dc_dz_seller_app_dv AS sta
|
|
|
|
1541
|
- LEFT JOIN `xt-member-two-LINE`.xt_seller AS s ON sta.sid = s.id
|
|
|
|
1542
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_type_rel AS rel ON sta.sid = rel.sid
|
|
|
|
1543
|
- WHERE
|
|
|
|
1544
|
- $__Where");
|
|
|
|
1545
|
- $list = Db::query("SELECT
|
|
|
|
1546
|
- s.sellername,
|
|
|
|
1547
|
- rel.type_id,
|
|
|
|
1548
|
- sta.*
|
|
|
|
1549
|
- FROM
|
|
|
|
1550
|
- `xt-member-two-LINE`.xt_dc_dz_seller_app_dv AS sta
|
|
|
|
1551
|
- LEFT JOIN `xt-member-two-LINE`.xt_seller AS s ON sta.sid = s.id
|
|
|
|
1552
|
- LEFT JOIN `xt-member-two-LINE`.xt_dc_dz_seller_type_rel AS rel ON sta.sid = rel.sid
|
|
|
|
1553
|
- WHERE
|
|
|
|
1554
|
- $__Where
|
|
|
|
1555
|
- ORDER BY
|
|
|
|
1556
|
- sta.sid
|
|
|
|
1557
|
- LIMIT $page,".$data['limit']);
|
|
|
|
1558
|
- foreach ($list as $key => $value) {
|
|
|
|
1559
|
-
|
|
|
|
1560
|
- //$list[$key]['call_jump_page'] = $value['call_jump_page'] == 1 ? "订座页面" : "桌位页面";
|
|
|
|
1561
|
-
|
|
|
|
1562
|
- switch ($value['type']) {
|
|
|
|
1563
|
- case '0':
|
|
|
|
1564
|
- $list[$key]['type'] = $facturer[0]['facturer'];
|
|
|
|
1565
|
- break;
|
|
|
|
1566
|
- case '1':
|
|
|
|
1567
|
- $list[$key]['type'] = $facturer[0]['facturer'];
|
|
|
|
1568
|
- break;
|
|
|
|
1569
|
- case '2':
|
|
|
|
1570
|
- $list[$key]['type'] = $facturer[1]['facturer'];
|
|
|
|
1571
|
- break;
|
|
|
|
1572
|
- case '3':
|
|
|
|
1573
|
- $list[$key]['type'] = $facturer[2]['facturer'];
|
|
|
|
1574
|
- break;
|
|
|
|
1575
|
- case '4':
|
|
|
|
1576
|
- $list[$key]['type'] = $facturer[3]['facturer'];
|
|
|
|
1577
|
- break;
|
|
|
|
1578
|
-
|
|
|
|
1579
|
- default:
|
|
|
|
1580
|
- $list[$key]['type'] = 'error: '.$value['type'];
|
|
|
|
1581
|
- break;
|
|
|
|
1582
|
- }
|
|
|
|
1583
|
-
|
314
|
+ $sql = "UPDATE `xt-member-two-LINE`.xt_dc_dz_card_info SET ";
|
|
|
|
315
|
+ foreach ($arr as $key=>$val){
|
|
|
|
316
|
+ $sql .= "".$key."='".$val."',";
|
|
1584
|
}
|
317
|
}
|
|
1585
|
- return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$list,'count'=>$total[0]['total'],'rel'=>1];
|
|
|
|
1586
|
- }
|
|
|
|
1587
|
- $this->assign ( 'title','设备列表');
|
|
|
|
1588
|
- return $this->fetch();
|
|
|
|
1589
|
- }
|
318
|
+ $sql = substr( $sql,0, strlen($sql)-1 );
|
|
|
|
319
|
+ $sql .= ' where id = '.$data['cid'];
|
|
1590
|
|
320
|
|
|
1591
|
- /**
|
|
|
|
1592
|
- * 商家基础信息配置
|
|
|
|
1593
|
- */
|
|
|
|
1594
|
- public function upcalljumppage(){
|
|
|
|
1595
|
- if(Request::isAjax()){
|
|
|
|
1596
|
- $data = Request::except('file');
|
|
|
|
1597
|
- $list= file_get_contents(ON_LINE.'Android.Device.UpDeviceCallJumpPage&device='.$data['device'].'&field='.'&status='.$data['status']);
|
|
|
|
1598
|
- $array = json_decode($list,TRUE);
|
|
|
|
1599
|
- if($array['ret']==200){
|
321
|
+ $ups = Db::query($sql);
|
|
|
|
322
|
+ if(!$ups){
|
|
1600
|
$result['code'] = 1;
|
323
|
$result['code'] = 1;
|
|
1601
|
- $result['msg'] = 'SUCCESS!';
|
324
|
+ $result['msg'] = '已成功投放!';
|
|
1602
|
}else{
|
325
|
}else{
|
|
1603
|
$result['code'] = 0;
|
326
|
$result['code'] = 0;
|
|
1604
|
- $result['msg'] = '请求错误!';
|
327
|
+ $result['msg'] = '请求错误,请联系管理员!';
|
|
1605
|
}
|
328
|
}
|
|
1606
|
return $result;
|
329
|
return $result;
|
|
1607
|
}
|
330
|
}
|
|
1608
|
- return view();
|
|
|
|
1609
|
- }
|
|
|
|
1610
|
-
|
|
|
|
1611
|
- /*
|
|
|
|
1612
|
- * 商家短信充值查询
|
|
|
|
1613
|
- */
|
|
|
|
1614
|
- public function getsellersmslist(){
|
|
|
|
1615
|
-
|
|
|
|
1616
|
- if(Request::isAjax()){
|
|
|
|
1617
|
- $data = Request::except('file');
|
|
|
|
1618
|
-
|
|
|
|
1619
|
- $time = (isset($data['time']) && !empty($data['time'])) ? explode(' - ',$data['time']) : (strtotime(date("Y-m-d 00:00:00")).'-'.strtotime(date("Y-m-d 23:59:59")));
|
|
|
|
1620
|
-
|
|
|
|
1621
|
- $newtime = is_array($time) ? (strtotime(date($time[0])).'-'.strtotime(date($time[1]))) : $time;
|
|
|
|
1622
|
-
|
|
|
|
1623
|
- $channel = (!isset($data['time'])) ? 1 : $data['channel'];
|
|
|
|
1624
|
-
|
|
|
|
1625
|
- $name = (!isset($data['time'])) ? '' : $data['key'];
|
|
|
|
1626
|
-
|
|
|
|
1627
|
- $url= ON_LINE.'App.Seller.QuerySelllerSmsList&offset='.$data['page'].'&size='.$data['limit'].'&time='.$newtime.'&channel='.$channel.'&name='.$name;
|
|
|
|
1628
|
-
|
|
|
|
1629
|
- $list = $this->curl_get($url);
|
|
|
|
1630
|
-
|
|
|
|
1631
|
- $array = json_decode($list,TRUE);
|
|
|
|
1632
|
-
|
|
|
|
1633
|
- if($array){
|
|
|
|
1634
|
- foreach ($array['data']['list'] as $key => $value) {
|
|
|
|
1635
|
- $array['data']['list'][$key]['bdate'] = date("Y年m月d日 H时i分s秒",$value['bdate']);
|
|
|
|
1636
|
- $array['data']['list'][$key]['paystatus'] = $value['paystatus']==1 ? '成功' : '失败';
|
|
|
|
1637
|
- $array['data']['list'][$key]['channel'] = $value['channel']==NULL ? '小程序' : $value['channel'];
|
|
|
|
1638
|
- $array['data']['list'][$key]['package_name'] = $value['package_name']=='other' ? '其他' : $value['package_name'];
|
|
|
|
1639
|
- }
|
|
|
|
1640
|
- return $result = [
|
|
|
|
1641
|
- 'code'=>0,'msg'=>'获取成功!',
|
|
|
|
1642
|
- 'data'=>$array['data']['list'],
|
|
|
|
1643
|
- 'count'=>$array['data']['total'],
|
|
|
|
1644
|
- 'rel'=>1
|
|
|
|
1645
|
- ];
|
|
|
|
1646
|
- }else{
|
|
|
|
1647
|
- $result['code'] = 0;
|
|
|
|
1648
|
- $result['msg'] = '请求错误!';
|
|
|
|
1649
|
- }
|
|
|
|
1650
|
- return $result;
|
|
|
|
1651
|
- }
|
|
|
|
1652
|
- return view();
|
|
|
|
1653
|
- }
|
|
|
|
1654
|
-
|
|
|
|
1655
|
- /**
|
|
|
|
1656
|
- * post
|
|
|
|
1657
|
- */
|
|
|
|
1658
|
- public function curl_get($url)
|
|
|
|
1659
|
- {
|
|
|
|
1660
|
-
|
|
|
|
1661
|
- $info = curl_init();
|
|
|
|
1662
|
- curl_setopt($info,CURLOPT_RETURNTRANSFER,true);
|
|
|
|
1663
|
- curl_setopt($info,CURLOPT_HEADER,0);
|
|
|
|
1664
|
- curl_setopt($info,CURLOPT_NOBODY,0);
|
|
|
|
1665
|
- curl_setopt($info,CURLOPT_SSL_VERIFYPEER,false);
|
|
|
|
1666
|
- curl_setopt($info,CURLOPT_SSL_VERIFYPEER,false);
|
|
|
|
1667
|
- curl_setopt($info,CURLOPT_SSL_VERIFYHOST,false);
|
|
|
|
1668
|
- curl_setopt($info,CURLOPT_URL,$url);
|
|
|
|
1669
|
- $output = curl_exec($info);
|
|
|
|
1670
|
- curl_close($info);
|
|
|
|
1671
|
- return $output;
|
331
|
+ //商家基本数据
|
|
|
|
332
|
+ $rs = Db::query("SELECT
|
|
|
|
333
|
+ id,
|
|
|
|
334
|
+ sellername,
|
|
|
|
335
|
+ card_title,
|
|
|
|
336
|
+ end_time
|
|
|
|
337
|
+ FROM
|
|
|
|
338
|
+ `xt-member-two-LINE`.xt_dc_dz_card_info
|
|
|
|
339
|
+ WHERE id=".$id['id']);
|
|
|
|
340
|
+ $this->assign ( 'rs',$rs[0]);
|
|
|
|
341
|
+ $this->assign ( 'title','卡券投放');
|
|
|
|
342
|
+ return $this->fetch();
|
|
1672
|
}
|
343
|
}
|
|
1673
|
} |
344
|
} |