删除无用的注释和文件
This commit is contained in:
parent
8f5b66bb92
commit
89bab045dd
|
@ -94,7 +94,6 @@ class ApproachController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建促销
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -114,25 +113,21 @@ class ApproachController extends WorkflowController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑进店
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核进店
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示进店
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示进店
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$this->layout = 'layouts.print2';
|
$this->layout = 'layouts.print2';
|
||||||
|
@ -357,7 +352,6 @@ class ApproachController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除进店申请
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -76,7 +76,6 @@ class MarketController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建促销
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -90,25 +89,21 @@ class MarketController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑促销
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核促销
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除促销
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
@ -128,11 +123,7 @@ class MarketController extends DefaultController
|
||||||
|
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
$model = DB::table('approach_market');
|
$model = DB::table('approach_market');
|
||||||
/*
|
|
||||||
foreach ($header['join'] as $join) {
|
|
||||||
$model->leftJoin($join[0], $join[1], $join[2], $join[3]);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if ($query['sort'] && $query['order']) {
|
if ($query['sort'] && $query['order']) {
|
||||||
$model->orderBy($query['sort'], $query['order']);
|
$model->orderBy($query['sort'], $query['order']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,6 @@ class ReviewController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建促销
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -106,25 +105,21 @@ class ReviewController extends WorkflowController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑促销
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核促销
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$this->layout = 'layouts.print2';
|
$this->layout = 'layouts.print2';
|
||||||
|
@ -163,7 +158,6 @@ class ReviewController extends WorkflowController
|
||||||
return $this->render(['query' => $query]);
|
return $this->render(['query' => $query]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除促销
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -101,7 +101,6 @@ class ArticleController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -111,7 +110,6 @@ class ArticleController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
|
|
|
@ -15,7 +15,7 @@ class CalendarController extends DefaultController
|
||||||
public $permission = ['calendars', 'help'];
|
public $permission = ['calendars', 'help'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示日历
|
* 日历首页
|
||||||
*/
|
*/
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
|
@ -46,8 +46,8 @@ class CalendarController extends DefaultController
|
||||||
$calendars = CalendarService::getCalendars($user_id);
|
$calendars = CalendarService::getCalendars($user_id);
|
||||||
|
|
||||||
$calendars[] = [
|
$calendars[] = [
|
||||||
'id' => 'shared',
|
'id' => 'shared',
|
||||||
'displayname' => '共享事件',
|
'displayname' => '共享事件',
|
||||||
'calendarcolor' => '#999',
|
'calendarcolor' => '#999',
|
||||||
];
|
];
|
||||||
$sources = [];
|
$sources = [];
|
||||||
|
@ -82,24 +82,20 @@ class CalendarController extends DefaultController
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->json($e->getMessage());
|
return $this->json($e->getMessage());
|
||||||
}
|
}
|
||||||
/*} else {
|
|
||||||
return $this->json('permission denied');
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
$calendar = CalendarService::getCalendar($gets['id'], false);
|
$calendar = CalendarService::getCalendar($gets['id'], false);
|
||||||
return $this->json([
|
return $this->json([
|
||||||
'active' => $gets['active'],
|
'active' => $gets['active'],
|
||||||
'eventSource' => array(
|
'eventSource' => array(
|
||||||
'id' => $calendar['id'],
|
'id' => $calendar['id'],
|
||||||
'url' => url('event/index', ['calendar_id' => $calendar['id']]),
|
'url' => url('event/index', ['calendar_id' => $calendar['id']]),
|
||||||
'backgroundColor' => $calendar['calendarcolor'],
|
'backgroundColor' => $calendar['calendarcolor'],
|
||||||
"borderColor" => $calendar['calendarcolor'],
|
"borderColor" => $calendar['calendarcolor'],
|
||||||
)
|
)
|
||||||
], true);
|
], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加日历
|
|
||||||
public function addAction()
|
public function addAction()
|
||||||
{
|
{
|
||||||
$gets = Request::all();
|
$gets = Request::all();
|
||||||
|
@ -123,7 +119,6 @@ class CalendarController extends DefaultController
|
||||||
return $this->render();
|
return $this->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除日历
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id');
|
$id = Request::get('id');
|
||||||
|
|
|
@ -19,7 +19,7 @@ class EventController extends DefaultController
|
||||||
{
|
{
|
||||||
public $permission = ['share', 'items'];
|
public $permission = ['share', 'items'];
|
||||||
|
|
||||||
// 事件对象
|
// 事件列表
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$gets = Request::all();
|
$gets = Request::all();
|
||||||
|
@ -137,14 +137,6 @@ class EventController extends DefaultController
|
||||||
$vcalendar = VObject::parse($event['calendardata']);
|
$vcalendar = VObject::parse($event['calendardata']);
|
||||||
$vevent = $vcalendar->VEVENT;
|
$vevent = $vcalendar->VEVENT;
|
||||||
|
|
||||||
/*
|
|
||||||
$accessclass = $vevent->getAsString('CLASS');
|
|
||||||
$permissions = CalendarService::getPermissions($id, Calendar::EVENT, $accessclass);
|
|
||||||
if(!$permissions & OCP\PERMISSION_UPDATE) {
|
|
||||||
return $this->json('permission denied');
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
$delta = new \DateInterval('P0D');
|
$delta = new \DateInterval('P0D');
|
||||||
$delta->s = $gets['delta'];
|
$delta->s = $gets['delta'];
|
||||||
|
|
||||||
|
@ -247,13 +239,6 @@ class EventController extends DefaultController
|
||||||
$end = $gets['end'];
|
$end = $gets['end'];
|
||||||
$allday = $gets['allDay'];
|
$allday = $gets['allDay'];
|
||||||
|
|
||||||
/*
|
|
||||||
if (!$end) {
|
|
||||||
$duration = 60;
|
|
||||||
$end = $start + ($duration * 60);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
$start = new \DateTime('@'.strtotime($start));
|
$start = new \DateTime('@'.strtotime($start));
|
||||||
$end = new \DateTime('@'.strtotime($end));
|
$end = new \DateTime('@'.strtotime($end));
|
||||||
|
|
||||||
|
@ -267,22 +252,7 @@ class EventController extends DefaultController
|
||||||
|
|
||||||
$calendar_options = CalendarService::getCalendars(Auth::id(), false);
|
$calendar_options = CalendarService::getCalendars(Auth::id(), false);
|
||||||
|
|
||||||
/*
|
|
||||||
分享日历暂时未实现
|
|
||||||
foreach($calendars as $calendar)
|
|
||||||
{
|
|
||||||
if($calendar['userid'] != OCP\User::getUser()) {
|
|
||||||
$sharedCalendar = OCP\Share::getItemSharedWithBySource('calendar', $calendar['id']);
|
|
||||||
if ($sharedCalendar && ($sharedCalendar['permissions'] & OCP\PERMISSION_UPDATE)) {
|
|
||||||
array_push($calendar_options, $calendar);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
array_push($calendar_options, $calendar);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$options['calendar_options'] = $calendar_options;
|
$options['calendar_options'] = $calendar_options;
|
||||||
|
|
||||||
$options['access_class_options'] = CalendarService::getAccessClassOptions();
|
$options['access_class_options'] = CalendarService::getAccessClassOptions();
|
||||||
$options['valarm_options'] = CalendarService::getValarmOptions();
|
$options['valarm_options'] = CalendarService::getValarmOptions();
|
||||||
$options['repeat_options'] = CalendarService::getRepeatOptions();
|
$options['repeat_options'] = CalendarService::getRepeatOptions();
|
||||||
|
@ -356,12 +326,12 @@ class EventController extends DefaultController
|
||||||
$end_at = strtotime($gets['to'].' '.$gets['totime']);
|
$end_at = strtotime($gets['to'].' '.$gets['totime']);
|
||||||
|
|
||||||
$share_data = array(
|
$share_data = array(
|
||||||
'source_id' => $gets['id'],
|
'source_id' => $gets['id'],
|
||||||
'source_type' => 'event',
|
'source_type' => 'event',
|
||||||
'receive_id' => $gets['receive_id'],
|
'receive_id' => $gets['receive_id'],
|
||||||
'receive_name' => $gets['receive_name'],
|
'receive_name' => $gets['receive_name'],
|
||||||
'start_at' => $start_at,
|
'start_at' => $start_at,
|
||||||
'end_at' => $end_at,
|
'end_at' => $end_at,
|
||||||
);
|
);
|
||||||
|
|
||||||
$share = ShareService::getItem('event', $gets['id']);
|
$share = ShareService::getItem('event', $gets['id']);
|
||||||
|
@ -374,7 +344,7 @@ class EventController extends DefaultController
|
||||||
return $this->json($e->getMessage());
|
return $this->json($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($data['calendarid'] != $gets['calendarid']) {
|
if ($event['calendarid'] != $gets['calendarid']) {
|
||||||
try {
|
try {
|
||||||
CalendarService::moveToCalendar($gets['id'], $gets['calendarid']);
|
CalendarService::moveToCalendar($gets['id'], $gets['calendarid']);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
@ -394,13 +364,6 @@ class EventController extends DefaultController
|
||||||
|
|
||||||
$object = VObject::parse($event['calendardata']);
|
$object = VObject::parse($event['calendardata']);
|
||||||
$vevent = $object->VEVENT;
|
$vevent = $object->VEVENT;
|
||||||
|
|
||||||
/*
|
|
||||||
$object = Sabre_Calendar_Object::cleanByAccessClass($id, $object);
|
|
||||||
$accessclass = $vevent->getAsString('CLASS');
|
|
||||||
$permissions = CalendarService::getPermissions($id, Calendar::EVENT, $accessclass);
|
|
||||||
*/
|
|
||||||
|
|
||||||
$dtstart = $vevent->DTSTART;
|
$dtstart = $vevent->DTSTART;
|
||||||
$dtend = CalendarService::getDTEndFromVEvent($vevent);
|
$dtend = CalendarService::getDTEndFromVEvent($vevent);
|
||||||
|
|
||||||
|
@ -573,7 +536,6 @@ class EventController extends DefaultController
|
||||||
$repeat['repeat'] = 'doesnotrepeat';
|
$repeat['repeat'] = 'doesnotrepeat';
|
||||||
}
|
}
|
||||||
|
|
||||||
// $options['category_options'] = CalendarService::getCategoryOptions();
|
|
||||||
$options['calendar_options']= CalendarService::getCalendars(Auth::id(), false);
|
$options['calendar_options']= CalendarService::getCalendars(Auth::id(), false);
|
||||||
$options['access_class_options'] = CalendarService::getAccessClassOptions();
|
$options['access_class_options'] = CalendarService::getAccessClassOptions();
|
||||||
$options['valarm_options'] = CalendarService::getValarmOptions();
|
$options['valarm_options'] = CalendarService::getValarmOptions();
|
||||||
|
@ -588,21 +550,9 @@ class EventController extends DefaultController
|
||||||
$options['repeat_byweekno_options'] = CalendarService::getByWeekNoOptions();
|
$options['repeat_byweekno_options'] = CalendarService::getByWeekNoOptions();
|
||||||
$options['repeat_bymonthday_options'] = CalendarService::getByMonthDayOptions();
|
$options['repeat_bymonthday_options'] = CalendarService::getByMonthDayOptions();
|
||||||
|
|
||||||
/*
|
|
||||||
if($permissions & OCP\PERMISSION_UPDATE) {
|
|
||||||
$tmpl = new OCP\Template('calendar', 'part.editevent');
|
|
||||||
} elseif($permissions & OCP\PERMISSION_READ) {
|
|
||||||
$tmpl = new OCP\Template('calendar', 'part.showevent');
|
|
||||||
} elseif($permissions === 0) {
|
|
||||||
OCP\JSON::error(array('data' => array('message' => CalendarService::$l10n->t('You do not have the permissions to edit this event.'))));
|
|
||||||
exit;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$options['id'] = $gets['id'];
|
$options['id'] = $gets['id'];
|
||||||
$options['permissions'] = $permissions;
|
|
||||||
$options['lastmodified'] = $event['lastmodified'];
|
$options['lastmodified'] = $event['lastmodified'];
|
||||||
$options['title'] = $summary;
|
$options['title'] = $summary;
|
||||||
$options['accessclass'] = $accessclass;
|
|
||||||
$options['location'] = $location;
|
$options['location'] = $location;
|
||||||
$options['categories'] = $categories;
|
$options['categories'] = $categories;
|
||||||
$options['calendarid'] = $event['calendarid'];
|
$options['calendarid'] = $event['calendarid'];
|
||||||
|
@ -707,7 +657,6 @@ class EventController extends DefaultController
|
||||||
$description = strtr($vevent->getAsString('DESCRIPTION'), array('\,' => ',', '\;' => ';'));
|
$description = strtr($vevent->getAsString('DESCRIPTION'), array('\,' => ',', '\;' => ';'));
|
||||||
|
|
||||||
$options['id'] = $id;
|
$options['id'] = $id;
|
||||||
$options['permissions'] = $permissions;
|
|
||||||
$options['lastmodified'] = $event['lastmodified'];
|
$options['lastmodified'] = $event['lastmodified'];
|
||||||
$options['title'] = $summary;
|
$options['title'] = $summary;
|
||||||
$options['location'] = $location;
|
$options['location'] = $location;
|
||||||
|
|
|
@ -491,51 +491,6 @@ class CalendarService
|
||||||
return $dtend;
|
return $dtend;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Remove all properties which should not be exported for the AccessClass Confidential
|
|
||||||
* @param string $id Event ID
|
|
||||||
* @param VObject $vobject Sabre VObject
|
|
||||||
* @return object
|
|
||||||
*/
|
|
||||||
public static function cleanByAccessClass($id, $vobject)
|
|
||||||
{
|
|
||||||
// Do not clean your own calendar
|
|
||||||
if (self::getowner($id) === Auth::id()) {
|
|
||||||
return $vobject;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($vobject->VEVENT)) {
|
|
||||||
$velement = $vobject->VEVENT;
|
|
||||||
} elseif (isset($vobject->VJOURNAL)) {
|
|
||||||
$velement = $vobject->VJOURNAL;
|
|
||||||
} elseif (isset($vobject->VTODO)) {
|
|
||||||
$velement = $vobject->VTODO;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($velement->CLASS) && $velement->CLASS->value == 'CONFIDENTIAL') {
|
|
||||||
foreach ($velement->children as &$property) {
|
|
||||||
switch ($property->name) {
|
|
||||||
case 'CREATED':
|
|
||||||
case 'DTSTART':
|
|
||||||
case 'RRULE':
|
|
||||||
case 'DURATION':
|
|
||||||
case 'DTEND':
|
|
||||||
case 'CLASS':
|
|
||||||
case 'UID':
|
|
||||||
break;
|
|
||||||
case 'SUMMARY':
|
|
||||||
$property->value = 'Busy';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$velement->__unset($property->name);
|
|
||||||
unset($property);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $vobject;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the permissions determined by the access class of an event/todo/journal
|
* @brief Get the permissions determined by the access class of an event/todo/journal
|
||||||
* @param VObject $vobject Sabre VObject
|
* @param VObject $vobject Sabre VObject
|
||||||
|
|
|
@ -441,9 +441,7 @@ class ChatController extends Controller
|
||||||
// 这里有一点bug,如果只有一条未读只能显示一条
|
// 这里有一点bug,如果只有一条未读只能显示一条
|
||||||
if ($unread_total > 0) {
|
if ($unread_total > 0) {
|
||||||
$model->where('cms.status', 0);
|
$model->where('cms.status', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//$model->whereRaw("(cm.receive_id = '$gid' and cm.id in(select message_id from chat_message_status where user_id = '$auth_id'))");
|
|
||||||
|
|
||||||
// 获取大于当前时间的记录
|
// 获取大于当前时间的记录
|
||||||
if ($lastdt > 0) {
|
if ($lastdt > 0) {
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
<?php namespace Gdoo\Customer\Controllers;
|
|
||||||
|
|
||||||
use Auth;
|
|
||||||
use Session;
|
|
||||||
use Request;
|
|
||||||
|
|
||||||
use Gdoo\User\Models\User;
|
|
||||||
use Gdoo\Index\Controllers\Controller;
|
|
||||||
|
|
||||||
class AuthController extends Controller
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 经销商业务员登录专用接口
|
|
||||||
*/
|
|
||||||
public function salemanAction()
|
|
||||||
{
|
|
||||||
if (Request::method() == 'POST') {
|
|
||||||
$gets = Request::all();
|
|
||||||
|
|
||||||
if (empty($gets['username'])) {
|
|
||||||
return $this->json('客户代码不能为空。');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = User::where('username', $gets['username'])
|
|
||||||
->where('status', 1)
|
|
||||||
->where('group_id', 2)->first();
|
|
||||||
|
|
||||||
if ($user->id > 0) {
|
|
||||||
Auth::login($user, true);
|
|
||||||
Session::put('auth_totp', true);
|
|
||||||
return $this->json('登录成功。', true);
|
|
||||||
} else {
|
|
||||||
return $this->json('登录失败,客户代码无效。');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->json('登录失败。');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function json($data, $status = false, $type = 'primary')
|
|
||||||
{
|
|
||||||
$json = [];
|
|
||||||
$json['status'] = $status;
|
|
||||||
$json['state'] = $status;
|
|
||||||
$json['info'] = $type;
|
|
||||||
$json['data'] = $data;
|
|
||||||
return response()->json($json);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -16,9 +16,6 @@ class ComplaintController extends WorkflowController
|
||||||
{
|
{
|
||||||
public $permission = ['dialog'];
|
public $permission = ['dialog'];
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单列表
|
|
||||||
*/
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
// 客户权限
|
// 客户权限
|
||||||
|
@ -84,7 +81,6 @@ class ComplaintController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建促销
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -107,27 +103,21 @@ class ComplaintController extends WorkflowController
|
||||||
return $this->display(['form' => $form], $tpl);
|
return $this->display(['form' => $form], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑促销
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('print');
|
return $this->createAction('print');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单删除
|
|
||||||
*/
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -76,7 +76,6 @@ class ContactController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -86,19 +85,16 @@ class ContactController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示客户联系人
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
@ -107,13 +103,10 @@ class ContactController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
'code' => 'customer_contact',
|
'code' => 'customer_contact',
|
||||||
]);
|
]);
|
||||||
$search = $header['search_form'];
|
$search = $header['search_form'];
|
||||||
$query = $search['query'];
|
$query = $search['query'];
|
||||||
|
@ -131,7 +124,7 @@ class ContactController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 客户圈权限
|
// 销售组权限
|
||||||
$region = regionCustomer();
|
$region = regionCustomer();
|
||||||
if ($region['authorise']) {
|
if ($region['authorise']) {
|
||||||
foreach ($region['whereIn'] as $key => $where) {
|
foreach ($region['whereIn'] as $key => $where) {
|
||||||
|
|
|
@ -93,7 +93,6 @@ class CustomerApplyController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction($action = 'create')
|
public function createAction($action = 'create')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -112,25 +111,21 @@ class CustomerApplyController extends WorkflowController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示客户联系人
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -101,7 +101,6 @@ class CustomerClassController extends DefaultController
|
||||||
$model->search($where);
|
$model->search($where);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// $model->where('end', 1);
|
|
||||||
$rows = $model->get();
|
$rows = $model->get();
|
||||||
return response()->json(['data' => $rows]);
|
return response()->json(['data' => $rows]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,6 @@ class CustomerController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction($action = 'create')
|
public function createAction($action = 'create')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -129,13 +128,11 @@ class CustomerController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批量编辑
|
|
||||||
public function batchEditAction()
|
public function batchEditAction()
|
||||||
{
|
{
|
||||||
$gets = Request::all();
|
$gets = Request::all();
|
||||||
|
@ -156,7 +153,6 @@ class CustomerController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 销售产品价格
|
|
||||||
public function priceEditAction()
|
public function priceEditAction()
|
||||||
{
|
{
|
||||||
$gets = Request::all();
|
$gets = Request::all();
|
||||||
|
@ -195,7 +191,6 @@ class CustomerController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示客户联系人
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
|
@ -211,7 +206,6 @@ class CustomerController extends DefaultController
|
||||||
return $this->render(['tips' => $tips], 'layouts.import');
|
return $this->render(['tips' => $tips], 'layouts.import');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
@ -220,9 +214,6 @@ class CustomerController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$search = search_form(
|
$search = search_form(
|
||||||
|
|
|
@ -75,7 +75,6 @@ class DeliveryAddressController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -85,19 +84,16 @@ class DeliveryAddressController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示客户联系人
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
@ -106,9 +102,6 @@ class DeliveryAddressController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
|
|
@ -86,7 +86,6 @@ class PriceController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建促销
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -96,19 +95,16 @@ class PriceController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑促销
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 客户价格列表
|
|
||||||
public function listAction()
|
public function listAction()
|
||||||
{
|
{
|
||||||
$gets = Request::all();
|
$gets = Request::all();
|
||||||
|
@ -135,7 +131,6 @@ class PriceController extends DefaultController
|
||||||
return $this->json($rows, true);
|
return $this->json($rows, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 参考客户价格
|
|
||||||
public function referCustomerAction()
|
public function referCustomerAction()
|
||||||
{
|
{
|
||||||
$search = search_form(
|
$search = search_form(
|
||||||
|
@ -186,7 +181,6 @@ class PriceController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 数据导入
|
|
||||||
public function importAction()
|
public function importAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
@ -196,7 +190,6 @@ class PriceController extends DefaultController
|
||||||
return $this->render(['tips' => $tips], 'layouts.import');
|
return $this->render(['tips' => $tips], 'layouts.import');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除促销
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -1,210 +0,0 @@
|
||||||
<?php namespace Gdoo\Customer\Controllers;
|
|
||||||
|
|
||||||
use DB;
|
|
||||||
use Request;
|
|
||||||
use Validator;
|
|
||||||
|
|
||||||
use Gdoo\User\Models\User;
|
|
||||||
use Gdoo\Customer\Models\Customer;
|
|
||||||
use Gdoo\Customer\Models\CustomerType;
|
|
||||||
use Gdoo\Index\Models\Region;
|
|
||||||
|
|
||||||
use Gdoo\Index\Controllers\DefaultController;
|
|
||||||
|
|
||||||
class ReconcileController extends DefaultController
|
|
||||||
{
|
|
||||||
public $permission = [];
|
|
||||||
|
|
||||||
// 单客户查询对账数据
|
|
||||||
public function queryAction()
|
|
||||||
{
|
|
||||||
$search = search_form([
|
|
||||||
'customer' => '',
|
|
||||||
'start_at' => '',
|
|
||||||
'end_at' => '',
|
|
||||||
], []);
|
|
||||||
|
|
||||||
$query = $search['query'];
|
|
||||||
|
|
||||||
if ($query['customer']) {
|
|
||||||
$customer = DB::table('customer')
|
|
||||||
->leftJoin('user', 'customer.user_id', '=', 'user.id')
|
|
||||||
->where('customer.id', $query['customer'])
|
|
||||||
->first();
|
|
||||||
|
|
||||||
$ch = curl_init(env('YONYOU_URL').'/yonyou.php?do=ar&start_at='.$query['start_at'].'&end_at='.$query['end_at'].'&customer_code='.$customer['username']);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
$res = curl_exec($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
$data = json_decode($res, true);
|
|
||||||
|
|
||||||
$lists = [];
|
|
||||||
foreach ($data as $row) {
|
|
||||||
$cDwCode = $row['cDwCode'];
|
|
||||||
$lists[$cDwCode][] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = [];
|
|
||||||
$total_start = $total_end = 0;
|
|
||||||
foreach ($lists as $code => $rows) {
|
|
||||||
$ye = 0;
|
|
||||||
foreach ($rows as $i => $row) {
|
|
||||||
|
|
||||||
$ye = $ye + $row['ye'];
|
|
||||||
$ye = $ye + $row['jf'] - $row['df'];
|
|
||||||
|
|
||||||
if($row['iYear'] && $row['iMonth'] && $row['iDay']) {
|
|
||||||
$date = date('Y-m-d', strtotime($row['iYear'].'-'.$row['iMonth'].'-'.$row['iDay']));
|
|
||||||
$jf = number_format($row['jf'], 2);
|
|
||||||
$df = number_format($row['df'], 2);
|
|
||||||
$res[] = [
|
|
||||||
'code' => $code,
|
|
||||||
'date' => $date,
|
|
||||||
'jmoney' => $jf,
|
|
||||||
'dmoney' => $df,
|
|
||||||
'balance' => number_format($ye, 2),
|
|
||||||
'ccusname' => $row['ccusname'],
|
|
||||||
'digest' => $row['cDigest'],
|
|
||||||
'ddh' => $row['ddh'],
|
|
||||||
'zp' => number_format($row['zp'], 2),
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
$res[] = [
|
|
||||||
'balance' => number_format($row['ye'], 2),
|
|
||||||
'ccusname' => $row['ccusname'],
|
|
||||||
'code' => $code,
|
|
||||||
'digest' => $row['cDigest'],
|
|
||||||
];
|
|
||||||
$total_start += $row['ye'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$res[] = [
|
|
||||||
'balance' => number_format($ye, 2),
|
|
||||||
'ccusname' => $rows[0]['ccusname'],
|
|
||||||
'code' => $code,
|
|
||||||
'digest' => '期末余额'
|
|
||||||
];
|
|
||||||
$total_end += $ye;
|
|
||||||
}
|
|
||||||
|
|
||||||
array_unshift($res, [
|
|
||||||
'balance' => number_format($total_start, 2),
|
|
||||||
'digest' => '总期初余额',
|
|
||||||
'ccusname' => '总期初合计',
|
|
||||||
]);
|
|
||||||
$res[] = [
|
|
||||||
'balance' => number_format($total_end, 2),
|
|
||||||
'digest' => '总期末余额',
|
|
||||||
'ccusname' => '总期末合计',
|
|
||||||
];
|
|
||||||
|
|
||||||
if (Request::method() == 'POST') {
|
|
||||||
return response()->json($res);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->display();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 生成对账单
|
|
||||||
public function createAction()
|
|
||||||
{
|
|
||||||
set_time_limit(0);
|
|
||||||
|
|
||||||
if (Request::method() == 'POST') {
|
|
||||||
$gets = Request::all();
|
|
||||||
|
|
||||||
$rules = [
|
|
||||||
'start_at' => 'required|date',
|
|
||||||
'end_at' => 'required|date',
|
|
||||||
];
|
|
||||||
|
|
||||||
$v = Validator::make($gets, $rules, [], ['start_at' => '开始日期', 'end_at' => '结束日期']);
|
|
||||||
if ($v->fails()) {
|
|
||||||
return $this->json($v->errors()->all());
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 数据同步 **/
|
|
||||||
$ch = curl_init(env('YONYOU_URL').'/yonyou.php?do=ar&start_at='.$gets['start_at'].'&end_at='.$gets['end_at']);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
$res = curl_exec($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
$res = json_decode($res, true);
|
|
||||||
|
|
||||||
// 获取客户数据
|
|
||||||
$customers = DB::table('user')
|
|
||||||
->leftJoin('customer', 'customer.user_id', '=', 'user.id')
|
|
||||||
->where('group_id', 2)
|
|
||||||
->pluck('customer.id', 'user.username');
|
|
||||||
|
|
||||||
$rows = [];
|
|
||||||
foreach ($res['data'] as $row) {
|
|
||||||
if ($row['code']) {
|
|
||||||
$rows[$row['code']][] = $row;
|
|
||||||
/*
|
|
||||||
if(empty($customers[$row['code']])) {
|
|
||||||
return $this->json('订单系统不存在此客户代码: ['.$row['code'].']');
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 总余额
|
|
||||||
$yes = $res['ye'];
|
|
||||||
|
|
||||||
foreach ($rows as $code => $row) {
|
|
||||||
$account_id = DB::table('customer_account')->insertGetId([
|
|
||||||
'sn' => date('Ymd').$code,
|
|
||||||
'date' => date('Ymd'),
|
|
||||||
'code' => $code,
|
|
||||||
'customer_id' => (int)$customers[$code],
|
|
||||||
'start_at' => $gets['start_at'],
|
|
||||||
'end_at' => $gets['end_at'],
|
|
||||||
]);
|
|
||||||
|
|
||||||
// 单客户余额
|
|
||||||
$ye = $yes[$row['zcode']] > 0 ? $yes[$row['zcode']] : 0.00;
|
|
||||||
|
|
||||||
// 写入余额数据
|
|
||||||
DB::table('customer_account_data')->insert([
|
|
||||||
'code' => $code,
|
|
||||||
'account_id' => $account_id,
|
|
||||||
'balance' => $ye,
|
|
||||||
'digest' => '期初余额小计',
|
|
||||||
]);
|
|
||||||
|
|
||||||
foreach ($row as $i => $cell) {
|
|
||||||
$ye = $ye + $cell['jf'] - $cell['df'];
|
|
||||||
|
|
||||||
$data = [
|
|
||||||
'account_id' => $account_id,
|
|
||||||
'sn' => date('Ymd').$i,
|
|
||||||
'date' => $cell['date'],
|
|
||||||
'ycode' => $cell['ycode'],
|
|
||||||
'zcode' => $cell['zcode'],
|
|
||||||
'code' => $cell['code'],
|
|
||||||
'jmoney' => $cell['jf'],
|
|
||||||
'dmoney' => $cell['df'],
|
|
||||||
'balance' => $ye,
|
|
||||||
'digest' => $cell['digest'],
|
|
||||||
];
|
|
||||||
|
|
||||||
DB::table('customer_account_data')->insert($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
DB::table('customer_account_data')->insert([
|
|
||||||
'code' => $code,
|
|
||||||
'account_id' => $account_id,
|
|
||||||
'balance' => $ye,
|
|
||||||
'digest' => '期木余额小计',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// 更新余额
|
|
||||||
DB::table('customer_account')->where('id', $account_id)->update([
|
|
||||||
'balance' => $ye,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
return $this->json('reload', true);
|
|
||||||
}
|
|
||||||
return $this->render();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -79,7 +79,6 @@ class RegionController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -97,7 +96,6 @@ class RegionController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
|
@ -149,7 +147,6 @@ class RegionController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -91,7 +91,6 @@ class RegionTaskController extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction($action = 'create')
|
public function createAction($action = 'create')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -112,13 +111,11 @@ class RegionTaskController extends AuditController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示客户联系人
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
|
@ -303,7 +300,6 @@ class RegionTaskController extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -81,7 +81,6 @@ class TaskController extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction($action = 'create')
|
public function createAction($action = 'create')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -101,13 +100,11 @@ class TaskController extends AuditController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示客户联系人
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
|
@ -367,7 +364,6 @@ class TaskController extends AuditController
|
||||||
return view('importExcel');
|
return view('importExcel');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -83,7 +83,6 @@ class TaxController extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -93,13 +92,11 @@ class TaxController extends AuditController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
|
@ -168,8 +165,7 @@ class TaxController extends AuditController
|
||||||
'header' => $header
|
'header' => $header
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -1,65 +0,0 @@
|
||||||
<?php namespace Gdoo\Customer\Controllers;
|
|
||||||
|
|
||||||
use Auth;
|
|
||||||
use Session;
|
|
||||||
use Request;
|
|
||||||
|
|
||||||
use Gdoo\User\Models\UserAsset;
|
|
||||||
use Gdoo\User\Models\User;
|
|
||||||
use Gdoo\Customer\Models\Customer;
|
|
||||||
use Gdoo\Customer\Models\Contact;
|
|
||||||
|
|
||||||
use Gdoo\User\Controllers\TokenController as Controller;
|
|
||||||
use Gdoo\User\Services\UserAssetService;
|
|
||||||
|
|
||||||
class TokenController extends Controller
|
|
||||||
{
|
|
||||||
public function salesmanAction()
|
|
||||||
{
|
|
||||||
if (Request::isJson()) {
|
|
||||||
$gets = json_decode(Request::getContent(), true);
|
|
||||||
} else {
|
|
||||||
$gets = Request::all();
|
|
||||||
}
|
|
||||||
|
|
||||||
$username = trim($gets['username']);
|
|
||||||
$password = trim($gets['password']);
|
|
||||||
|
|
||||||
if ($username == '') {
|
|
||||||
return response()->json(['message'=>'客户代码不能为空。']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($password == '') {
|
|
||||||
return response()->json(['message'=>'联系人手机不能为空。']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取登录用户
|
|
||||||
$user = User::where('username', $username)
|
|
||||||
->where('group_id', 2)
|
|
||||||
->where('status', 1)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if ($user) {
|
|
||||||
// 获取客户档案
|
|
||||||
$customer = Customer::where('user_id', $user->id)->first();
|
|
||||||
|
|
||||||
// 登录的客户业务员信息
|
|
||||||
$contact = Contact::leftJoin('user', 'user.id', '=', 'customer_contact.user_id')
|
|
||||||
->where('customer_contact.customer_id', $customer->id)
|
|
||||||
->where('user.phone', $password)
|
|
||||||
->first(['user.*', 'customer_contact.id as contact_id']);
|
|
||||||
|
|
||||||
if ($contact) {
|
|
||||||
$assets = UserAssetService::getRoleAssets($user->role_id);
|
|
||||||
return response()->json([
|
|
||||||
'token' => $this->createToken($user->id),
|
|
||||||
'contact_id' => $contact->contact_id,
|
|
||||||
'access' => $assets,
|
|
||||||
]);
|
|
||||||
} else {
|
|
||||||
return response()->json(['message'=>'客户代码或联系人手机错误。']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return response()->json(['message'=>'客户代码或联系人手机错误。']);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -69,7 +69,6 @@ class TypeController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -79,7 +78,6 @@ class TypeController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
|
@ -107,7 +105,6 @@ class TypeController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -1,129 +0,0 @@
|
||||||
<div class="panel">
|
|
||||||
<div class="wrapper-sm">
|
|
||||||
|
|
||||||
<form class="form-inline" method="post" id="query-form" name="query-form">
|
|
||||||
|
|
||||||
<div class="form-inline">
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<?php $m = date('Y-m-01'); ?>
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="col-sm-12">
|
|
||||||
<label class="control-label">对账客户</label>
|
|
||||||
{{App\Support\Dialog::user('customer', 'customer', '', 0, 0, 135)}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="col-sm-12">
|
|
||||||
<label class="control-label">开始日期</label>
|
|
||||||
<input class="form-control input-sm" data-toggle="date" type="text" name="start_at" id="start_at" placeholder="开始日期" value="{{$m}}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group m-b-xs">
|
|
||||||
<div class="col-sm-12">
|
|
||||||
<label class="control-label">开始日期</label>
|
|
||||||
<input class="form-control input-sm" data-toggle="date" type="text" id="end_at" placeholder="开始日期" name="end_at" value="{{date('Y-m-d', strtotime("$m +1 month -1 day"))}}">
|
|
||||||
<div class="visible-xs-block m-t"></div>
|
|
||||||
<span class="hidden-xs"> </span>
|
|
||||||
<a href="javascript:formQuery();" class="btn btn-sm btn-info"><i class="icon icon-search"></i> 查询</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="list-jqgrid">
|
|
||||||
<table id="account-single"></table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var $table = null;
|
|
||||||
var params = {};
|
|
||||||
|
|
||||||
(function($) {
|
|
||||||
|
|
||||||
$table = $("#account-single");
|
|
||||||
var model = [
|
|
||||||
{name: "ccusname", hidden: true, index: 'ccusname', label: '客户名称', width: 100, align: 'center'},
|
|
||||||
{name: "date", index: 'date', label: '单据日期', width: 100, align: 'center'},
|
|
||||||
{name: "ddh", index: 'ddh', label: '订单号', width: 120, align: 'left'},
|
|
||||||
{name: "digest", index: 'digest', label: '摘要', width: 220, align: 'left'},
|
|
||||||
{name: "zp", index: 'zp', label: '赠品金额', width: 180, align: 'right'},
|
|
||||||
{name: "jmoney", index: 'jmoney', label: '本期应收金额', width: 180, align: 'right'},
|
|
||||||
{name: "dmoney", index: 'dmoney', label: '本期收回金额', width: 180, align: 'right'},
|
|
||||||
{name: "balance", index: 'balance', label: '余额', width: 180, align: 'right'}
|
|
||||||
];
|
|
||||||
|
|
||||||
$table.jqGrid({
|
|
||||||
caption: '',
|
|
||||||
datatype: 'json',
|
|
||||||
mtype: 'POST',
|
|
||||||
url: app.url('customer/account/query'),
|
|
||||||
colModel: model,
|
|
||||||
rowNum: 1000,
|
|
||||||
multiselect: false,
|
|
||||||
viewrecords: true,
|
|
||||||
rownumbers: true,
|
|
||||||
height: getPanelHeight(),
|
|
||||||
footerrow: false,
|
|
||||||
postData: params,
|
|
||||||
grouping:true,
|
|
||||||
groupingView : {
|
|
||||||
groupField : ['ccusname'],//分组属性
|
|
||||||
groupColumnShow : [false,false],//是否显示分组列
|
|
||||||
groupText : ['<b>{0}</b>'],//表头显示数据(每组中包含的数据量)
|
|
||||||
groupCollapse :false,//加载数据时是否只显示分组的组信息
|
|
||||||
groupSummary : [false,false],//是否显示汇总 如果为true需要在colModel中进行配置summaryType:'max',summaryTpl:'<b>Max: {0}</b>'
|
|
||||||
groupDataSorted : false,//分组中的数据是否排序
|
|
||||||
groupOrder:['desc','desc'] , //分组后组的排列顺序
|
|
||||||
//showSummaryOnHide: true//是否在分组底部显示汇总信息并且当收起表格时是否隐藏下面的分组
|
|
||||||
},
|
|
||||||
|
|
||||||
gridComplete: function() {
|
|
||||||
$(this).jqGrid('setColsWidth');
|
|
||||||
},
|
|
||||||
loadComplete: function(res) {
|
|
||||||
var me = $(this);
|
|
||||||
me.jqGrid('initPagination', res);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
})(jQuery);
|
|
||||||
|
|
||||||
|
|
||||||
function formQuery()
|
|
||||||
{
|
|
||||||
var query_form = $('#query-form');
|
|
||||||
var query = query_form.serializeArray();
|
|
||||||
for (var i = 0; i < query.length; i++) {
|
|
||||||
params[query[i].name] = query[i].value;
|
|
||||||
}
|
|
||||||
|
|
||||||
$table.jqGrid('setGridParam', {
|
|
||||||
postData: params,
|
|
||||||
page: 1
|
|
||||||
}).trigger('reloadGrid');
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPanelHeight() {
|
|
||||||
var list = $('.list-jqgrid').position();
|
|
||||||
return top.iframeHeight - list.top - 45;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 框架页面改变大小时会调用此方法
|
|
||||||
function iframeResize() {
|
|
||||||
// 框架改变大小时设置Panel高度
|
|
||||||
$table.jqGrid('setPanelHeight', getPanelHeight());
|
|
||||||
// resize jqgrid大小
|
|
||||||
$table.jqGrid('resizeGrid');
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -84,7 +84,6 @@ class AdjustController extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 其他费用
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -103,19 +102,16 @@ class AdjustController extends AuditController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑促销
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除促销
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -67,7 +67,6 @@ class CategoryController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -77,27 +76,11 @@ class CategoryController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示客户联系人
|
|
||||||
public function showAction()
|
|
||||||
{
|
|
||||||
$id = (int)Request::get('id');
|
|
||||||
$group = Category::find($id);
|
|
||||||
$options = [
|
|
||||||
'table' => 'customer_cost_category',
|
|
||||||
'row' => $group,
|
|
||||||
];
|
|
||||||
$tpl = Form::show($options);
|
|
||||||
return $this->display([
|
|
||||||
'tpl' => $tpl,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$search = search_form([], [
|
$search = search_form([], [
|
||||||
|
@ -106,7 +89,7 @@ class CategoryController extends DefaultController
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
$model = Type::orderBy('sort', 'asc');
|
$model = Category::orderBy('sort', 'asc');
|
||||||
foreach ($search['where'] as $where) {
|
foreach ($search['where'] as $where) {
|
||||||
if ($where['active']) {
|
if ($where['active']) {
|
||||||
$model->search($where);
|
$model->search($where);
|
||||||
|
|
|
@ -80,7 +80,6 @@ class CompenController extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 其他费用
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -99,13 +98,11 @@ class CompenController extends AuditController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑促销
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
|
@ -155,7 +152,6 @@ class CompenController extends AuditController
|
||||||
return view('importExcel');
|
return view('importExcel');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除促销
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -96,7 +96,6 @@ class CostController extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 其他费用
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -115,13 +114,11 @@ class CostController extends AuditController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑促销
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
|
@ -245,7 +242,6 @@ class CostController extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除促销
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -80,7 +80,6 @@ class RebateController extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 其他费用
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -99,13 +98,11 @@ class RebateController extends AuditController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑促销
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
|
@ -116,17 +113,13 @@ class RebateController extends AuditController
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
$file = Request::file('file');
|
$file = Request::file('file');
|
||||||
if ($file->isValid()) {
|
if ($file->isValid()) {
|
||||||
$types = DB::table('customer_order_type')->get()->keyBy('name');
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
[0] => 客户编码
|
[0] => 客户编码
|
||||||
[1] => 客户名称
|
[1] => 客户名称
|
||||||
[2] => 金额
|
[2] => 金额
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$rows = readExcel($file->getPathName());
|
$rows = readExcel($file->getPathName());
|
||||||
$items = [];
|
$items = [];
|
||||||
|
|
||||||
$codes = [];
|
$codes = [];
|
||||||
foreach($rows as $i => $row) {
|
foreach($rows as $i => $row) {
|
||||||
if ($i > 1) {
|
if ($i > 1) {
|
||||||
|
@ -155,7 +148,6 @@ class RebateController extends AuditController
|
||||||
return view('importExcel');
|
return view('importExcel');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除促销
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -66,14 +66,7 @@ class ReportController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 销售会计审核日期
|
$rows = $model->orderBy('m.id', 'asc')
|
||||||
$rows = $model->leftJoin(DB::raw("(select max(d.updated_at) as audit_date, m.data_id
|
|
||||||
FROM model_run_log as d left join model_run as m on d.run_id = m.id where m.bill_id = 23 and d.run_name = '销售会计'
|
|
||||||
GROUP BY m.data_id
|
|
||||||
) as l
|
|
||||||
"), 'l.data_id', '=', 'm.id')
|
|
||||||
->whereRaw("(".sql_year_month('l.audit_date', 'ts')." BETWEEN ? AND ?)", $fields['date'])
|
|
||||||
->orderBy(DB::raw(sql_year_month('l.audit_date', 'ts')), 'asc')
|
|
||||||
->get()->toArray();
|
->get()->toArray();
|
||||||
|
|
||||||
foreach($rows as &$row) {
|
foreach($rows as &$row) {
|
||||||
|
|
|
@ -10,6 +10,7 @@ use URL;
|
||||||
use Gdoo\File\Models\Attachment;
|
use Gdoo\File\Models\Attachment;
|
||||||
|
|
||||||
use Gdoo\Index\Controllers\DefaultController;
|
use Gdoo\Index\Controllers\DefaultController;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class AttachmentController extends DefaultController
|
class AttachmentController extends DefaultController
|
||||||
{
|
{
|
||||||
|
@ -25,9 +26,6 @@ class AttachmentController extends DefaultController
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加文件到草稿
|
|
||||||
*/
|
|
||||||
public function draftAction()
|
public function draftAction()
|
||||||
{
|
{
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
@ -69,9 +67,6 @@ class AttachmentController extends DefaultController
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 查看文件
|
|
||||||
*/
|
|
||||||
public function fileinfoAction()
|
public function fileinfoAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id', 0);
|
$id = Request::get('id', 0);
|
||||||
|
@ -86,11 +81,6 @@ class AttachmentController extends DefaultController
|
||||||
return $this->json('文件不存在。');
|
return $this->json('文件不存在。');
|
||||||
}
|
}
|
||||||
|
|
||||||
//$isimg = '|jpg|png|gif|bmp|jpeg|', '|'.$ext.'|';
|
|
||||||
//$isoffice = '|doc|docx|xls|xlsx|ppt|pptx|pdf|', '|'.$ext.'|';
|
|
||||||
//$isbianju = '|doc|docx|xls|xlsx|ppt|pptx|', '|'.$ext.'|';
|
|
||||||
//$isyulan = ',txt,log,html,htm,js,php,php3,mp4,md,cs,sql,java,json,css,asp,aspx,shtml,cpp,c,vbs,jsp,xml,bat,ini,conf,sh,', ','.$ext.',';
|
|
||||||
|
|
||||||
$isview = 0;
|
$isview = 0;
|
||||||
$isimg = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];
|
$isimg = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];
|
||||||
if (in_array($file['type'], $isimg)) {
|
if (in_array($file['type'], $isimg)) {
|
||||||
|
@ -156,9 +146,6 @@ class AttachmentController extends DefaultController
|
||||||
$size = $file->getSize();
|
$size = $file->getSize();
|
||||||
$name = $file->getClientOriginalName();
|
$name = $file->getClientOriginalName();
|
||||||
$extension = strtolower($file->getClientOriginalExtension());
|
$extension = strtolower($file->getClientOriginalExtension());
|
||||||
//$name = $paths['filename'];
|
|
||||||
//$extension = strtolower($name);
|
|
||||||
//$_FILES['Filedata']['size']
|
|
||||||
|
|
||||||
// 保存附件的表名
|
// 保存附件的表名
|
||||||
$table = empty($gets['model']) ? 'attachment' : $gets['model'];
|
$table = empty($gets['model']) ? 'attachment' : $gets['model'];
|
||||||
|
@ -168,24 +155,20 @@ class AttachmentController extends DefaultController
|
||||||
|
|
||||||
// 附件存放目录
|
// 附件存放目录
|
||||||
$upload_path = upload_path($path);
|
$upload_path = upload_path($path);
|
||||||
/*
|
|
||||||
if(!is_dir($upload_path)) {
|
|
||||||
mkdir($upload_path, 0755, true);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// 附件新名字
|
// 附件新名字
|
||||||
$filename = date('ymdhi').str_random(4).".".$extension;
|
$filename = date('ymdhi').Str::random(4).".".$extension;
|
||||||
|
|
||||||
if (in_array($extension, explode(',', $upload_type))) {
|
if (in_array($extension, explode(',', $upload_type))) {
|
||||||
// 移动文件
|
// 移动文件
|
||||||
if ($file->move($upload_path, $filename)) {
|
if ($file->move($upload_path, $filename)) {
|
||||||
$data = [
|
$data = [
|
||||||
'title' => $name,
|
'title' => $name,
|
||||||
'path' => $path,
|
'path' => $path,
|
||||||
'type' => $extension,
|
'type' => $extension,
|
||||||
'name' => $filename,
|
'name' => $filename,
|
||||||
'size' => $size,
|
'size' => $size,
|
||||||
'add_time' => time(),
|
'add_time' => time(),
|
||||||
'add_user_id' => Auth::id(),
|
'add_user_id' => Auth::id(),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -219,10 +202,7 @@ class AttachmentController extends DefaultController
|
||||||
$size = $file->getSize();
|
$size = $file->getSize();
|
||||||
$name = $file->getClientOriginalName();
|
$name = $file->getClientOriginalName();
|
||||||
$extension = strtolower($file->getClientOriginalExtension());
|
$extension = strtolower($file->getClientOriginalExtension());
|
||||||
//$name = $paths['filename'];
|
|
||||||
//$extension = strtolower($name);
|
|
||||||
//$_FILES['Filedata']['size']
|
|
||||||
|
|
||||||
// 保存附件的表名
|
// 保存附件的表名
|
||||||
$table = empty($gets['model']) ? 'attachment' : $gets['model'];
|
$table = empty($gets['model']) ? 'attachment' : $gets['model'];
|
||||||
|
|
||||||
|
@ -231,23 +211,19 @@ class AttachmentController extends DefaultController
|
||||||
|
|
||||||
// 附件存放目录
|
// 附件存放目录
|
||||||
$upload_path = upload_path($path);
|
$upload_path = upload_path($path);
|
||||||
/*
|
|
||||||
if(!is_dir($upload_path)) {
|
|
||||||
mkdir($upload_path, 0755, true);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// 附件新名字
|
// 附件新名字
|
||||||
$filename = date('ymdhi').str_random(4).".".$extension;
|
$filename = date('ymdhi').Str::random(4).".".$extension;
|
||||||
|
|
||||||
if (in_array($extension, explode(',', $upload_type))) {
|
if (in_array($extension, explode(',', $upload_type))) {
|
||||||
// 移动文件
|
// 移动文件
|
||||||
if ($file->move($upload_path, $filename)) {
|
if ($file->move($upload_path, $filename)) {
|
||||||
$insert_id = DB::table($table)->insertGetId([
|
$insert_id = DB::table($table)->insertGetId([
|
||||||
'title' => $name,
|
'title' => $name,
|
||||||
'path' => $path,
|
'path' => $path,
|
||||||
'type' => $extension,
|
'type' => $extension,
|
||||||
'name' => $filename,
|
'name' => $filename,
|
||||||
'size' => $size,
|
'size' => $size,
|
||||||
'add_time' => time(),
|
'add_time' => time(),
|
||||||
'add_user_id' => Auth::id(),
|
'add_user_id' => Auth::id(),
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -9,6 +9,7 @@ use Validator;
|
||||||
use Gdoo\Model\Grid;
|
use Gdoo\Model\Grid;
|
||||||
|
|
||||||
use Gdoo\File\Models\Certificate;
|
use Gdoo\File\Models\Certificate;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class CertificateController extends DefaultController
|
class CertificateController extends DefaultController
|
||||||
{
|
{
|
||||||
|
@ -83,13 +84,12 @@ class CertificateController extends DefaultController
|
||||||
// 扩展名称
|
// 扩展名称
|
||||||
$extension = $file->getClientOriginalExtension();
|
$extension = $file->getClientOriginalExtension();
|
||||||
// 附件新名字
|
// 附件新名字
|
||||||
$filename = date('dhis_').str_random(4).'.'.$extension;
|
$filename = date('dhis_').Str::random(4).'.'.$extension;
|
||||||
$filename = mb_strtolower($filename);
|
$filename = mb_strtolower($filename);
|
||||||
$uploadSuccess = $file->move($upload_path, $filename);
|
$uploadSuccess = $file->move($upload_path, $filename);
|
||||||
if ($uploadSuccess) {
|
if ($uploadSuccess) {
|
||||||
// 数据库写入
|
// 数据库写入
|
||||||
$draft = new Certificate;
|
$draft = new Certificate;
|
||||||
//$draft->name = mb_strtolower($file->getClientOriginalName());
|
|
||||||
$draft->name = $name;
|
$draft->name = $name;
|
||||||
$draft->path = $path.'/'.$filename;
|
$draft->path = $path.'/'.$filename;
|
||||||
$draft->type = $extension;
|
$draft->type = $extension;
|
||||||
|
|
|
@ -8,6 +8,7 @@ use Gdoo\Index\Models\Share;
|
||||||
use Gdoo\File\Models\File;
|
use Gdoo\File\Models\File;
|
||||||
|
|
||||||
use Gdoo\Index\Controllers\DefaultController;
|
use Gdoo\Index\Controllers\DefaultController;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class FileController extends DefaultController
|
class FileController extends DefaultController
|
||||||
{
|
{
|
||||||
|
@ -105,7 +106,7 @@ class FileController extends DefaultController
|
||||||
// 扩展名称
|
// 扩展名称
|
||||||
$extension = $file->getClientOriginalExtension();
|
$extension = $file->getClientOriginalExtension();
|
||||||
// 附件新名字
|
// 附件新名字
|
||||||
$filename = date('dhis_').str_random(4).'.'.$extension;
|
$filename = date('dhis_').Str::random(4).'.'.$extension;
|
||||||
$filename = mb_strtolower($filename);
|
$filename = mb_strtolower($filename);
|
||||||
|
|
||||||
$uploadSuccess = $file->move($upload_path, $filename);
|
$uploadSuccess = $file->move($upload_path, $filename);
|
||||||
|
@ -132,12 +133,7 @@ class FileController extends DefaultController
|
||||||
// 个人云盘
|
// 个人云盘
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$search = search_form([
|
|
||||||
'referer' => 1,
|
|
||||||
], []);
|
|
||||||
|
|
||||||
$user_id = auth()->id();
|
$user_id = auth()->id();
|
||||||
|
|
||||||
$parent_id = Request::get('parent_id', 0);
|
$parent_id = Request::get('parent_id', 0);
|
||||||
|
|
||||||
$rows = DB::table('file')
|
$rows = DB::table('file')
|
||||||
|
@ -187,11 +183,7 @@ class FileController extends DefaultController
|
||||||
// 共享给我的
|
// 共享给我的
|
||||||
public function receivedataAction()
|
public function receivedataAction()
|
||||||
{
|
{
|
||||||
$search = search_form([
|
$user_id = Request::get('user_id');
|
||||||
'referer' => 1,
|
|
||||||
], []);
|
|
||||||
|
|
||||||
$user_id = Request::get('user_id');
|
|
||||||
$parent_id = Request::get('parent_id');
|
$parent_id = Request::get('parent_id');
|
||||||
|
|
||||||
// 共享的全部文件和文件夹
|
// 共享的全部文件和文件夹
|
||||||
|
@ -250,20 +242,16 @@ class FileController extends DefaultController
|
||||||
|
|
||||||
$user = $row = DB::table('user')->where('id', $user_id)->first();
|
$user = $row = DB::table('user')->where('id', $user_id)->first();
|
||||||
return $this->display([
|
return $this->display([
|
||||||
'rows' => $rows,
|
'rows' => $rows,
|
||||||
'breadcrumb' => $breadcrumb,
|
'breadcrumb' => $breadcrumb,
|
||||||
'parent_id' => $parent_id,
|
'parent_id' => $parent_id,
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 我共享的
|
// 我共享的
|
||||||
public function shareAction()
|
public function shareAction()
|
||||||
{
|
{
|
||||||
$search = search_form([
|
|
||||||
'referer' => 1,
|
|
||||||
], []);
|
|
||||||
|
|
||||||
$user_id = Request::get('user_id', auth()->id());
|
$user_id = Request::get('user_id', auth()->id());
|
||||||
|
|
||||||
// 共享的全部文件和文件夹
|
// 共享的全部文件和文件夹
|
||||||
|
@ -323,9 +311,9 @@ class FileController extends DefaultController
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->display([
|
return $this->display([
|
||||||
'rows' => $rows,
|
'rows' => $rows,
|
||||||
'breadcrumb' => $breadcrumb,
|
'breadcrumb' => $breadcrumb,
|
||||||
'parent_id' => $parent_id,
|
'parent_id' => $parent_id,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,8 +333,6 @@ class FileController extends DefaultController
|
||||||
|
|
||||||
$rows = [
|
$rows = [
|
||||||
'name' => '公共网盘', 'type' => '',
|
'name' => '公共网盘', 'type' => '',
|
||||||
'name' => '公共网盘',
|
|
||||||
'name' => '公共网盘',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->display([
|
return $this->display([
|
||||||
|
|
|
@ -9,6 +9,7 @@ use Validator;
|
||||||
use Gdoo\Model\Grid;
|
use Gdoo\Model\Grid;
|
||||||
|
|
||||||
use Gdoo\File\Models\InspectReport;
|
use Gdoo\File\Models\InspectReport;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class InspectReportController extends DefaultController
|
class InspectReportController extends DefaultController
|
||||||
{
|
{
|
||||||
|
@ -83,13 +84,12 @@ class InspectReportController extends DefaultController
|
||||||
// 扩展名称
|
// 扩展名称
|
||||||
$extension = $file->getClientOriginalExtension();
|
$extension = $file->getClientOriginalExtension();
|
||||||
// 附件新名字
|
// 附件新名字
|
||||||
$filename = date('dhis_').str_random(4).'.'.$extension;
|
$filename = date('dhis_').Str::random(4).'.'.$extension;
|
||||||
$filename = mb_strtolower($filename);
|
$filename = mb_strtolower($filename);
|
||||||
$uploadSuccess = $file->move($upload_path, $filename);
|
$uploadSuccess = $file->move($upload_path, $filename);
|
||||||
if ($uploadSuccess) {
|
if ($uploadSuccess) {
|
||||||
// 数据库写入
|
// 数据库写入
|
||||||
$draft = new InspectReport;
|
$draft = new InspectReport;
|
||||||
//$draft->name = mb_strtolower($file->getClientOriginalName());
|
|
||||||
$draft->name = $name;
|
$draft->name = $name;
|
||||||
$draft->path = $path.'/'.$filename;
|
$draft->path = $path.'/'.$filename;
|
||||||
$draft->type = $extension;
|
$draft->type = $extension;
|
||||||
|
|
|
@ -1,111 +0,0 @@
|
||||||
<?php namespace Gdoo\File\Controllers;
|
|
||||||
|
|
||||||
use Request;
|
|
||||||
use URL;
|
|
||||||
|
|
||||||
use Gdoo\Index\Controllers\Controller;
|
|
||||||
|
|
||||||
class WidgetController extends Controller
|
|
||||||
{
|
|
||||||
public $permission = ['index', 'download'];
|
|
||||||
|
|
||||||
public $rows = [/*[
|
|
||||||
'title' => '盛华管理手机客户端',
|
|
||||||
'date' => '2018-04-09',
|
|
||||||
'android_url' => '/uploads/com.shenghua.oa/1.0.12.apk',
|
|
||||||
'ios_url' => ''
|
|
||||||
],[
|
|
||||||
'title' => '盛华市场手机客户端',
|
|
||||||
'date' => '2018-04-07',
|
|
||||||
'android_url' => '/uploads/com.shenghua.customer/1.0.3.apk',
|
|
||||||
'ios_url' => '/uploads/com.shenghua.customer/1.0.3.ipa'
|
|
||||||
],*/[
|
|
||||||
'title' => '身份验证器(GoogleAuthenticator)',
|
|
||||||
'date' => '2015-06-17',
|
|
||||||
'android_url' => '/uploads/android/authenticator2_21.apk',
|
|
||||||
'ios_url' => ''
|
|
||||||
],[
|
|
||||||
'title' => '日历同步助手(Caldav)',
|
|
||||||
'date' => '2017-06-29',
|
|
||||||
'android_url' => '/uploads/android/calendar.caldav.sync.apk',
|
|
||||||
'ios_url' => ''
|
|
||||||
]];
|
|
||||||
|
|
||||||
public function downloadAction()
|
|
||||||
{
|
|
||||||
$key = Request::get('key');
|
|
||||||
$row = $this->rows[$key];
|
|
||||||
|
|
||||||
$file = '';
|
|
||||||
|
|
||||||
if (get_device_type() == 'ios') {
|
|
||||||
if ($row['ios_url']) {
|
|
||||||
$file = url($row['ios_url']);
|
|
||||||
}
|
|
||||||
$img = '/assets/images/ios_download.png';
|
|
||||||
} else {
|
|
||||||
if ($row['android_url']) {
|
|
||||||
$file = url($row['android_url']);
|
|
||||||
}
|
|
||||||
$img = '/assets/images/android_download.png';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_weixin()) {
|
|
||||||
echo '<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta name="viewport" content="width=device-width" />
|
|
||||||
<title></title>
|
|
||||||
<style>
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
background-color:#a2a2a2;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div>
|
|
||||||
<img src="'.$img.'" />
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>';
|
|
||||||
} else {
|
|
||||||
if ($file) {
|
|
||||||
echo "<form action='".$file."' id='go' method='GET'></form><script type='text/javascript'>document.getElementById('go').submit();</script>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function indexAction()
|
|
||||||
{
|
|
||||||
if (Request::isJson()) {
|
|
||||||
foreach ($this->rows as $k => &$row) {
|
|
||||||
$url = '';
|
|
||||||
|
|
||||||
if ($row['android_url']) {
|
|
||||||
$url .= '<a class="option" href="'.url($row['android_url']).'"><i class="fa fa-fw fa-android"></i></a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($row['ios_url']) {
|
|
||||||
$url .= ' <a class="option" href="'.url($row['ios_url']).'"><i class="fa fa-fw fa-apple"></i></a>';
|
|
||||||
} else {
|
|
||||||
$url .= ' <span class="text-muted" href="javascript:;"><i class="fa fa-fw fa-apple"></i></span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$qrcodeURL = url('index/api/qrcode', ['size' => 6, 'data' => url('file/widget/download', ['key' => $k])]);
|
|
||||||
|
|
||||||
$url .= ' <a class="option" href="javascript:;" onclick=\'$.messager.alert("'.$row['title'].'","<div align=\"center\"><img src=\"'.$qrcodeURL.'\"></div>");\'><i class="fa fa-fw fa-qrcode"></i></a>';
|
|
||||||
|
|
||||||
$row['option'] = $url;
|
|
||||||
}
|
|
||||||
|
|
||||||
$json['total'] = sizeof($this->rows);
|
|
||||||
$json['data'] = $this->rows;
|
|
||||||
return response()->json($json);
|
|
||||||
}
|
|
||||||
return $this->render();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
<table id="widget-file-file">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th data-field="title" data-align="left">标题</th>
|
|
||||||
<th data-field="date" data-width="160" data-align="center">日期</th>
|
|
||||||
<th data-field="option" data-width="200" data-align="center">下载</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
(function($) {
|
|
||||||
var $table = $('#widget-file-file');
|
|
||||||
$table.bootstrapTable({
|
|
||||||
sidePagination: 'server',
|
|
||||||
showColumns: false,
|
|
||||||
showHeader: false,
|
|
||||||
height: 200,
|
|
||||||
pagination: false,
|
|
||||||
url: '{{url("file/widget/index")}}',
|
|
||||||
});
|
|
||||||
|
|
||||||
})(jQuery);
|
|
||||||
</script>
|
|
|
@ -1,12 +1,12 @@
|
||||||
<?php namespace Gdoo\Forum\Controllers;
|
<?php namespace Gdoo\Forum\Controllers;
|
||||||
|
|
||||||
use DB;
|
use DB;
|
||||||
|
use Request;
|
||||||
|
|
||||||
use Gdoo\Index\Controllers\DefaultController;
|
use Gdoo\Index\Controllers\DefaultController;
|
||||||
|
|
||||||
class CategoryController extends DefaultController
|
class CategoryController extends DefaultController
|
||||||
{
|
{
|
||||||
// 论坛类别
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
// 更新排序
|
// 更新排序
|
||||||
|
@ -29,7 +29,6 @@ class CategoryController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 论坛列别编辑
|
|
||||||
public function addAction()
|
public function addAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -52,11 +51,10 @@ class CategoryController extends DefaultController
|
||||||
$row = DB::table('forum')->where('id', $id)->first();
|
$row = DB::table('forum')->where('id', $id)->first();
|
||||||
|
|
||||||
return $this->display(array(
|
return $this->display(array(
|
||||||
'row' => $row,
|
'row' => $row,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 论坛列别删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if ($id = Request::get('id')) {
|
if ($id = Request::get('id')) {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
use DB;
|
use DB;
|
||||||
use Auth;
|
use Auth;
|
||||||
|
use Request;
|
||||||
|
|
||||||
use Gdoo\Forum\Models\Forum;
|
use Gdoo\Forum\Models\Forum;
|
||||||
use Gdoo\Forum\Models\ForumPost;
|
use Gdoo\Forum\Models\ForumPost;
|
||||||
|
|
|
@ -6,6 +6,7 @@ use Validator;
|
||||||
use DB;
|
use DB;
|
||||||
|
|
||||||
use Gdoo\Index\Services\AttachmentService;
|
use Gdoo\Index\Services\AttachmentService;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use URL;
|
use URL;
|
||||||
|
|
||||||
class AttachmentController extends DefaultController
|
class AttachmentController extends DefaultController
|
||||||
|
@ -20,13 +21,6 @@ class AttachmentController extends DefaultController
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
$file = Request::file('file');
|
$file = Request::file('file');
|
||||||
|
|
||||||
/*
|
|
||||||
$rules = [
|
|
||||||
'file' => 'mimes:'.$this->setting['upload_type'],
|
|
||||||
];
|
|
||||||
$v = Validator::make(['file' => $file], $rules);
|
|
||||||
*/
|
|
||||||
|
|
||||||
$upload_type = explode(',', $this->setting['upload_type']);
|
$upload_type = explode(',', $this->setting['upload_type']);
|
||||||
|
|
||||||
if ($file->isValid()) {
|
if ($file->isValid()) {
|
||||||
|
@ -47,7 +41,7 @@ class AttachmentController extends DefaultController
|
||||||
$upload_path = upload_path().'/'.$path;
|
$upload_path = upload_path().'/'.$path;
|
||||||
|
|
||||||
// 文件新名字
|
// 文件新名字
|
||||||
$filename = date('dhis_').str_random(4).'.'.$extension;
|
$filename = date('dhis_').Str::random(4).'.'.$extension;
|
||||||
$filename = mb_strtolower($filename);
|
$filename = mb_strtolower($filename);
|
||||||
|
|
||||||
if ($file->move($upload_path, $filename)) {
|
if ($file->move($upload_path, $filename)) {
|
||||||
|
@ -98,7 +92,7 @@ class AttachmentController extends DefaultController
|
||||||
$extension = $file->getClientOriginalExtension();
|
$extension = $file->getClientOriginalExtension();
|
||||||
|
|
||||||
// 文件新名字
|
// 文件新名字
|
||||||
$filename = date('dhis_').str_random(4).'.'.$extension;
|
$filename = date('dhis_').Str::random(4).'.'.$extension;
|
||||||
$filename = mb_strtolower($filename);
|
$filename = mb_strtolower($filename);
|
||||||
|
|
||||||
if ($file->move($upload_path, $filename)) {
|
if ($file->move($upload_path, $filename)) {
|
||||||
|
|
|
@ -4,11 +4,6 @@ use DB;
|
||||||
use URL;
|
use URL;
|
||||||
use Request;
|
use Request;
|
||||||
|
|
||||||
use App\Support\Pinyin;
|
|
||||||
|
|
||||||
use Gdoo\User\Models\User;
|
|
||||||
use Gdoo\Index\Models\Notification;
|
|
||||||
|
|
||||||
class DemoController extends Controller
|
class DemoController extends Controller
|
||||||
{
|
{
|
||||||
#[Attribute(Attribute::TARGET_FUNCTION)]
|
#[Attribute(Attribute::TARGET_FUNCTION)]
|
||||||
|
@ -19,501 +14,5 @@ class DemoController extends Controller
|
||||||
|
|
||||||
public function helloAction()
|
public function helloAction()
|
||||||
{
|
{
|
||||||
//\App\Jobs\SendEmail::dispatch('abc', ['fvzone@qq.com'], '您的验证码是0123', 'fsdafsd哈哈哈');
|
|
||||||
//\App\Jobs\SendSms::dispatch(['15182223008'], '您的验证码是01234');
|
|
||||||
|
|
||||||
$menus = DB::table('menu')->get();
|
|
||||||
foreach($menus as $menu) {
|
|
||||||
$url = str_replace('.', '/', $menu['url']);
|
|
||||||
DB::table('menu')->where('id', $menu['id'])->update([
|
|
||||||
'url' => $url,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//\App\Jobs\SendSite::dispatch([1], '您的验证码是0123');
|
|
||||||
exit;
|
|
||||||
|
|
||||||
/*
|
|
||||||
$dbParams = array(
|
|
||||||
'dbname' => 'gdoooa_demo',
|
|
||||||
'user' => 'root',
|
|
||||||
'password' => 'root',
|
|
||||||
'host' => 'localhost:3307',
|
|
||||||
'driver' => 'pdo_mysql',
|
|
||||||
'charset' => 'utf8mb4',
|
|
||||||
'default_table_options' => [
|
|
||||||
'charset' => 'utf8mb4',
|
|
||||||
'collate' => 'utf8mb4_unicode_ci',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
$paths = array(base_path(). "/abc");
|
|
||||||
$isDevMode = false;
|
|
||||||
|
|
||||||
$config = \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
|
|
||||||
$em = \Doctrine\ORM\EntityManager::create($dbParams, $config);
|
|
||||||
|
|
||||||
$platform = $em->getConnection()->getDatabasePlatform();
|
|
||||||
$platform->registerDoctrineTypeMapping('enum', 'string');
|
|
||||||
|
|
||||||
$metadata = $em->getClassMetadata('App\\Share');
|
|
||||||
//$cmf = $em->getMetadataFactory();
|
|
||||||
//$class = $cmf->getMetadataFor('Share');
|
|
||||||
print_r($metadata);
|
|
||||||
*/
|
|
||||||
|
|
||||||
$abc['indexes'] = [
|
|
||||||
'idx_object_id' => [
|
|
||||||
'columns' => ['source_id'],
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
$abc['columns'] = [
|
|
||||||
'id' => [
|
|
||||||
'name' => '',
|
|
||||||
'type' => '',
|
|
||||||
'default' => '',
|
|
||||||
'notnull' => '',
|
|
||||||
'length' => '',
|
|
||||||
'unsigned' => '',
|
|
||||||
'autoincrement' => '',
|
|
||||||
'comment' => '',
|
|
||||||
], 'name' => [
|
|
||||||
'name' => '',
|
|
||||||
'type' => '',
|
|
||||||
'default' => '',
|
|
||||||
'notnull' => '',
|
|
||||||
'length' => '',
|
|
||||||
'unsigned' => '',
|
|
||||||
'autoincrement' => '',
|
|
||||||
'comment' => '',
|
|
||||||
]];
|
|
||||||
|
|
||||||
file_put_contents(base_path().'/abc.json', json_encode($abc, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
|
|
||||||
|
|
||||||
/*
|
|
||||||
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
|
|
||||||
$sm = $conn->getSchemaManager();
|
|
||||||
$columns = $sm->listTableColumns('role');
|
|
||||||
|
|
||||||
foreach ($columns as $column) {
|
|
||||||
$column->
|
|
||||||
echo $column->getName() . ': ' . $column->getType() . "\n";
|
|
||||||
}
|
|
||||||
print_r($columns);
|
|
||||||
*/
|
|
||||||
exit;
|
|
||||||
|
|
||||||
$abc = \Gdoo\Produce\Services\ProduceService::getPlanDetail('2020-08-01', '2020-08-04', 0, 0, 0);
|
|
||||||
// $abc = \Gdoo\Stock\Service\StockService::reportOrderStockInOut(139, 0, '', '', '2020-08-01', '2020-09-21', 1, 1, 0);
|
|
||||||
print_r($abc);
|
|
||||||
exit;
|
|
||||||
|
|
||||||
/*
|
|
||||||
$rows = DB::table('model_permission')->get();
|
|
||||||
foreach($rows as $row) {
|
|
||||||
$data = json_decode($row['data'], true);
|
|
||||||
print_r($data);
|
|
||||||
foreach($data as $k => $rr) {
|
|
||||||
// _product
|
|
||||||
print_r($k);
|
|
||||||
echo "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exit;
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
$users = DB::table('user')
|
|
||||||
->where('group_id', 2)
|
|
||||||
->get(['id','status', 'name', 'username']);
|
|
||||||
|
|
||||||
foreach($users as $user) {
|
|
||||||
DB::table('customer')->where('user_id', $user['id'])->update([
|
|
||||||
'status' => $user['status'],
|
|
||||||
'name' => $user['name'],
|
|
||||||
'code' => $user['username'],
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
echo 'demo';
|
|
||||||
exit;
|
|
||||||
*/
|
|
||||||
|
|
||||||
$gets['stock_allocation']['out_warehouse_id'] = 111;
|
|
||||||
if($gets['stock_allocation']['out_warehouse_id'] <> 140 and $gets['stock_allocation']['out_warehouse_id'] <> 139 and $gets['stock_allocation']['out_warehouse_id'] <> 20005 and $gets['stock_allocation']['out_warehouse_id'] <> 20048) {
|
|
||||||
echo '1111111111111';
|
|
||||||
}
|
|
||||||
|
|
||||||
if($gets['stock_allocation']['out_warehouse_id'] == 140 or $gets['stock_allocation']['out_warehouse_id'] == 139 or $gets['stock_allocation']['out_warehouse_id'] == 20005 or $gets['stock_allocation']['out_warehouse_id'] == 20048) {
|
|
||||||
echo '22222222222222';
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
exit;
|
|
||||||
|
|
||||||
/*
|
|
||||||
$customers = DB::table('tbb_customer')
|
|
||||||
->get(['tbb_customer.*']);
|
|
||||||
|
|
||||||
$users = [];
|
|
||||||
foreach($customers as $customer) {
|
|
||||||
$users[] = [
|
|
||||||
'id' => $customer['CustID'],
|
|
||||||
'code' => $customer['cCusCode'],
|
|
||||||
'name' => $customer['cCusName'],
|
|
||||||
'tel' => $customer['cCusPhone'],
|
|
||||||
'fax' => $customer['cCusFax'],
|
|
||||||
'address' => $customer['cCusAddress'],
|
|
||||||
|
|
||||||
'head_phone' => $customer['cCusLPersonPhone'],
|
|
||||||
'head_name' => $customer['cCusLPerson'],
|
|
||||||
'email' => $customer['cCusEmail'],
|
|
||||||
|
|
||||||
// 直营 3
|
|
||||||
'type_id' => (int)($customer['bZykh2'] == 1 ? 3 : 1),
|
|
||||||
|
|
||||||
// 是否调拨
|
|
||||||
'is_allocate' => (int)$customer['bZykh'],
|
|
||||||
|
|
||||||
// 一般纳税人
|
|
||||||
'general_taxpayer' => (int)$customer['Sfybnsr'],
|
|
||||||
|
|
||||||
'status' => (int)$customer['Status'],
|
|
||||||
|
|
||||||
'warehouse_address' => $customer['CustWhAddress'],
|
|
||||||
'warehouse_tel' => $customer['TelPhone'],
|
|
||||||
'warehouse_contact' => $customer['CustWhPerson'],
|
|
||||||
'warehouse_phone' => $customer['CustWhPhone'],
|
|
||||||
'warehouse_size' => $customer['CustWhSqure'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
$pwd = bcrypt('123456');
|
|
||||||
foreach($users as $user) {
|
|
||||||
DB::table('user')->insert([
|
|
||||||
'id' => $user['id'],
|
|
||||||
'username' => $user['code'],
|
|
||||||
'name' => $user['name'],
|
|
||||||
'email' => $user['email'],
|
|
||||||
'phone' => $user['head_phone'],
|
|
||||||
'status' => $user['status'],
|
|
||||||
'group_id' => 2,
|
|
||||||
'role_id' => 2,
|
|
||||||
'password' => $pwd,
|
|
||||||
]);
|
|
||||||
DB::table('customer')->insert($user);
|
|
||||||
}
|
|
||||||
exit;
|
|
||||||
|
|
||||||
$ufcustomer = DB::table('ufcustomer')->get()->toArray();
|
|
||||||
$ccodes = [];
|
|
||||||
foreach($ufcustomer as $_ufcustomer) {
|
|
||||||
$ccodes[$_ufcustomer['cCusHeadCode']][] = $_ufcustomer['cCusCode'];
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($ccodes as $cid => $_codes) {
|
|
||||||
foreach($_codes as $i => $_code) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
//100189
|
|
||||||
|
|
||||||
$ufcustomer = DB::table('ufcustomer')->get()->toArray();
|
|
||||||
$ccodes = [];
|
|
||||||
foreach($ufcustomer as $_ufcustomer) {
|
|
||||||
$ccodes[$_ufcustomer['cCusHeadCode']][] = $_ufcustomer['cCusCode'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$users = DB::table('user')->where('group_id', 2)->get()->keyBy('username')->toArray();
|
|
||||||
foreach($ccodes as $cid => $_codes) {
|
|
||||||
foreach($_codes as $i => $_code) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
set_time_limit(0);
|
|
||||||
$rows = file_get_contents(public_path('r.json'));
|
|
||||||
$rows = json_decode($rows, true);
|
|
||||||
foreach($rows as $row) {
|
|
||||||
$id1 = DB::table('region')->insertGetId(['name' => $row['name'], 'code' => $row['code'], 'layer' => 1]);
|
|
||||||
foreach($row['cityList'] as $city) {
|
|
||||||
$id2 = DB::table('region')->insertGetId(['layer' => 2, 'parent_id' => $id1, 'name' => $city['name'], 'code' => $city['code']]);
|
|
||||||
foreach($city['areaList'] as $area) {
|
|
||||||
DB::table('region')->insertGetId(['layer' => 3, 'parent_id' => $id2, 'name' => $area['name'], 'code' => $area['code']]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo 111;
|
|
||||||
*/
|
|
||||||
exit;
|
|
||||||
|
|
||||||
/*
|
|
||||||
\App\Jobs\SendSite::dispatch([1], '您的验证码是0123');
|
|
||||||
exit;
|
|
||||||
|
|
||||||
DB::enableQueryLog();
|
|
||||||
$user = DB::table('user as u')->orderBy('id', 'desc')->orderBy('username', 'asc')->first();
|
|
||||||
print_r(DB::getQueryLog());
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
$units = option('product.unit')->pluck('id', 'name');
|
|
||||||
$rows = DB::table('product')->get();
|
|
||||||
foreach($rows as $row) {
|
|
||||||
$unit = strtolower($row['unit']);
|
|
||||||
if (isset($units[$unit])) {
|
|
||||||
$row['unit_id'] = $units[$unit];
|
|
||||||
DB::table('product')->where('id', $row['id'])->update($row);
|
|
||||||
} else {
|
|
||||||
echo $unit."\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
exit;
|
|
||||||
/*
|
|
||||||
$t1 = microtime(true);
|
|
||||||
|
|
||||||
$stocks = DB::table('stock_yonyou_data')
|
|
||||||
->groupBy('code')
|
|
||||||
->selectRaw('sum(quantity_set - quantity_get) as quantity,code')
|
|
||||||
->pluck('quantity', 'code');
|
|
||||||
|
|
||||||
$abc = 0;
|
|
||||||
foreach ($stocks as $stock) {
|
|
||||||
$abc += $stock;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo $abc."<br>";
|
|
||||||
|
|
||||||
$t2 = microtime(true);
|
|
||||||
echo '耗时'.($t2 - $t1).'秒';
|
|
||||||
|
|
||||||
``
|
|
||||||
|
|
||||||
exit;
|
|
||||||
*/
|
|
||||||
|
|
||||||
//$abc = \Yunpian::send('15182223008', '您的验证码是5967');
|
|
||||||
//print_r($abc);
|
|
||||||
//exit;
|
|
||||||
|
|
||||||
/*
|
|
||||||
$agentid = 1000035;
|
|
||||||
$url = 'http://www.shenghuafood.com/article/article/view?id=1336&agentid='.$agentid;
|
|
||||||
//$url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww42727b1e44abc7fa&redirect_uri='.$u.'&response_type=code&scope=snsapi_privateinfo&agentid='.$agentid.'&state='.$agentid.'#wechat_redirect';
|
|
||||||
|
|
||||||
$msg = array(
|
|
||||||
'touser' => 'qy01bbfb5d6f30ae009bc0e5b8fb',
|
|
||||||
'toparty' => '',
|
|
||||||
'msgtype' => 'news',
|
|
||||||
'agentid' => $agentid,
|
|
||||||
'news' => array(
|
|
||||||
"articles"=> array(
|
|
||||||
0 => array(
|
|
||||||
"title" => "有新的公告提醒",
|
|
||||||
"description" => "[公告】关于西安大军区的调整公告",
|
|
||||||
"url" => $url,
|
|
||||||
"picurl" => ""
|
|
||||||
))
|
|
||||||
)
|
|
||||||
'text' => array(
|
|
||||||
"content"=>"各部门及同事:\n".
|
|
||||||
"为更好的服务好再来大厦,满足大厦入驻员工的班车需求,现对部分班车路线及时刻做相应调整,自2016年9月20日零时生效。详情点击\n<a href=\"http://banche.hoolilai.com\">http://banche.hoolilai.com</a>"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$api = new \App\Wechat\Work\App($agentid);
|
|
||||||
|
|
||||||
var_dump($api->sendMsgToUser($msg));
|
|
||||||
|
|
||||||
*/
|
|
||||||
$xml = simplexml_load_file('tpl.xml');
|
|
||||||
/*
|
|
||||||
$attributes = $xml->record->attributes();
|
|
||||||
foreach ($attributes as $k => $v) {
|
|
||||||
print_r($k.'---'.$v);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
$form = $xml->xpath("record[@type='form']/form")[0];
|
|
||||||
|
|
||||||
foreach ($form as $key => $node) {
|
|
||||||
if ($key == 'group') {
|
|
||||||
$fields = [];
|
|
||||||
foreach ($node as $k => $field) {
|
|
||||||
if ($k == 'field') {
|
|
||||||
$attr = $field->attributes();
|
|
||||||
$col = $attr['col'] - 2;
|
|
||||||
$abc[] = '<label class="col-sm-2 control-label" for=""><span class="red">*</span> 供应商</label>';
|
|
||||||
$abc[] = '<div class="col-sm-'.$col.' control-text"><input type="text" value="180407-185" required="required" class="form-control input-sm" id="supplier_price_sn" name="supplier_price[sn]" readonly="readonly"></div>';
|
|
||||||
}
|
|
||||||
//print_r($k);
|
|
||||||
}
|
|
||||||
print_r($abc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//$abc = Yunpian::send('15182223008', '您的验证码是5967');
|
|
||||||
//print_r($abc);
|
|
||||||
|
|
||||||
//$ab = new Hawind\Core();
|
|
||||||
|
|
||||||
// 开启 log
|
|
||||||
//DB::connection()->enableQueryLog();
|
|
||||||
|
|
||||||
//$abc = User::whereIn('user.id', [1,2,3,4])->select(['user.*','user.name as role_name'])->paginate();
|
|
||||||
|
|
||||||
// 获取已执行的查询数组
|
|
||||||
//$abc = DB::getQueryLog();
|
|
||||||
|
|
||||||
//$ab->test($abc);
|
|
||||||
|
|
||||||
//print_r($abc);
|
|
||||||
|
|
||||||
//print_r($cron->isDue());
|
|
||||||
//$cron = Cron\CronExpression::factory('0 0 0 ? 1/2 FRI#2 *');
|
|
||||||
//if ($cron->isDue()) {
|
|
||||||
// The promotion should be enabled!
|
|
||||||
//}
|
|
||||||
|
|
||||||
/*
|
|
||||||
$datas = DB::table('stock')
|
|
||||||
->where('date', '0000-00-00')
|
|
||||||
->get();
|
|
||||||
|
|
||||||
foreach ($datas as $key => $data) {
|
|
||||||
$data['date'] = date('Y-m-d', $data['add_time']);
|
|
||||||
DB::table('stock')->where('id', $data['id'])->update($data);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
$logs = DB::table('model_step_log')
|
|
||||||
->where('table', 'promotion')
|
|
||||||
->where('step_status', 'next')
|
|
||||||
->where('created_id', '278')
|
|
||||||
->get();
|
|
||||||
|
|
||||||
foreach ($logs as $log) {
|
|
||||||
$data['data_30'] = date('Y-m-d', $log['created_at']);
|
|
||||||
DB::table('promotion')->where('id', $log['table_id'])->update($data);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
//$sms = new iscms\Alisms\SendsmsPusher();
|
|
||||||
|
|
||||||
//$t = "项目流程提醒! 主题:关于违反销售管理制度之扣分——龚涛天 -【销售行为】处罚等待确认!";
|
|
||||||
//$words = Yunpian::replaceWords($t);
|
|
||||||
|
|
||||||
//$t = str_replace($words[0], $words[1], $t);
|
|
||||||
|
|
||||||
//$b = mb_str_split('销售');
|
|
||||||
|
|
||||||
//print_r(var_dump($words));
|
|
||||||
|
|
||||||
//$abc = Yunpian::getBlackWord($words);
|
|
||||||
|
|
||||||
//$abc = Yunpian::getTpl('1701454');
|
|
||||||
|
|
||||||
// $abc = Yunpian::getUser();
|
|
||||||
|
|
||||||
//print_r($abc['balance'] / 0.05);
|
|
||||||
|
|
||||||
//print_r($words);
|
|
||||||
|
|
||||||
exit;
|
|
||||||
|
|
||||||
/*
|
|
||||||
$departments = DB::table('department')->pluck('name', 'id');
|
|
||||||
$roles = DB::table('role')->pluck('name', 'id');
|
|
||||||
$users = DB::table('user')->pluck('name', 'id');
|
|
||||||
|
|
||||||
$shares = DB::table('article')->get();
|
|
||||||
|
|
||||||
foreach ($shares as $share) {
|
|
||||||
|
|
||||||
$id = $name = [];
|
|
||||||
|
|
||||||
$share_user = explode(',', $share['user_id']);
|
|
||||||
foreach ($share_user as $user) {
|
|
||||||
if($users[$user]) {
|
|
||||||
$id[] = 'u'.$user;
|
|
||||||
$name[] = $users[$user];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$share_role = explode(',', $share['role_id']);
|
|
||||||
foreach ($share_role as $role) {
|
|
||||||
if($roles[$role]) {
|
|
||||||
$id[] = 'r'.$role;
|
|
||||||
$name[] = $roles[$role];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$share_department = explode(',', $share['department_id']);
|
|
||||||
foreach ($share_department as $department) {
|
|
||||||
if($departments[$department]) {
|
|
||||||
$id[] = 'd'.$department;
|
|
||||||
$name[] = $departments[$department];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DB::table('article')->where('id', $share['id'])->update([
|
|
||||||
'receive_id' => join(',', $id),
|
|
||||||
'receive_name' => join(',', $name)
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
$users = User::get();
|
|
||||||
|
|
||||||
foreach ($users as $user) {
|
|
||||||
|
|
||||||
if($user->password_text == '' && mb_strlen($user->password) == 32) {
|
|
||||||
$user->password = \Hash::make($user->username);
|
|
||||||
$user->password_text = $user->username;
|
|
||||||
$user->save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
$p2 = DB::connection('sqlite')
|
|
||||||
->table('city')
|
|
||||||
->where('parent_id', 2621)
|
|
||||||
->get();
|
|
||||||
|
|
||||||
print_r($p2);
|
|
||||||
exit;
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
// app()->configure('pcas');
|
|
||||||
|
|
||||||
// $abc = config('pcas');
|
|
||||||
|
|
||||||
// print_r(json_encode($abc, JSON_UNESCAPED_UNICODE));
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
$users = DB::table('user')->get();
|
|
||||||
|
|
||||||
foreach ($users as $user) {
|
|
||||||
|
|
||||||
$data['warehouse_tel'] = $user['warehouse_tel'];
|
|
||||||
$data['warehouse_contact'] = $user['warehouse_contact'];
|
|
||||||
$data['warehouse_phone'] = $user['warehouse_phone'];
|
|
||||||
$data['warehouse_address'] = $user['warehouse_address'];
|
|
||||||
$data['invoice_type'] = $user['invoice'];
|
|
||||||
|
|
||||||
DB::table('customer')->where('user_id', $user['id'])->update($data);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// print_r(123);
|
|
||||||
// exit;
|
|
||||||
// return $this->render([]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -14,11 +14,8 @@ use Gdoo\Index\Controllers\DefaultController;
|
||||||
|
|
||||||
class ModuleController extends DefaultController
|
class ModuleController extends DefaultController
|
||||||
{
|
{
|
||||||
public $permission = ['test', 'refresh'];
|
public $permission = ['refresh'];
|
||||||
|
|
||||||
/**
|
|
||||||
* 邮件设置
|
|
||||||
*/
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = [
|
$header = [
|
||||||
|
@ -146,59 +143,11 @@ class ModuleController extends DefaultController
|
||||||
$header['search_form'] = $search;
|
$header['search_form'] = $search;
|
||||||
$header['js'] = Grid::js($header);
|
$header['js'] = Grid::js($header);
|
||||||
|
|
||||||
// 配置权限
|
|
||||||
return $this->display([
|
return $this->display([
|
||||||
'header' => $header,
|
'header' => $header,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建邮箱帐号
|
|
||||||
public function createAction()
|
|
||||||
{
|
|
||||||
return $this->editAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 编辑邮箱帐号
|
|
||||||
public function editAction()
|
|
||||||
{
|
|
||||||
$id = (int)Request::get('id');
|
|
||||||
$row = DB::table('mail')->where('id', $id)->first();
|
|
||||||
return $this->render([
|
|
||||||
'row' => $row,
|
|
||||||
], 'edit');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存
|
|
||||||
*/
|
|
||||||
public function storeAction()
|
|
||||||
{
|
|
||||||
if (Request::method() == 'POST') {
|
|
||||||
$gets = Request::all();
|
|
||||||
$rules = [
|
|
||||||
'name' => 'required',
|
|
||||||
'smtp' => 'required',
|
|
||||||
'user' => 'required',
|
|
||||||
'password' => 'required',
|
|
||||||
'port' => 'required',
|
|
||||||
];
|
|
||||||
$v = Validator::make($gets, $rules);
|
|
||||||
if ($v->fails()) {
|
|
||||||
return $this->json(join('<br>', $v->errors()->all()));
|
|
||||||
|
|
||||||
}
|
|
||||||
if ($gets['id']) {
|
|
||||||
DB::table('mail')->where('id', $gets['id'])->update($gets);
|
|
||||||
} else {
|
|
||||||
DB::table('mail')->insert($gets);
|
|
||||||
}
|
|
||||||
return $this->json('恭喜你,操作成功。', true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -20,9 +20,6 @@ class StepController extends DefaultController
|
||||||
{
|
{
|
||||||
public $permission = ['condition', 'steps', 'index2', 'save', 'add', 'show'];
|
public $permission = ['condition', 'steps', 'index2', 'save', 'add', 'show'];
|
||||||
|
|
||||||
/**
|
|
||||||
* 步骤列表
|
|
||||||
*/
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
// 更新排序
|
// 更新排序
|
||||||
|
@ -61,9 +58,6 @@ class StepController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 步骤列表
|
|
||||||
*/
|
|
||||||
public function index2Action()
|
public function index2Action()
|
||||||
{
|
{
|
||||||
// 更新排序
|
// 更新排序
|
||||||
|
@ -127,7 +121,7 @@ class StepController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加步骤和克隆步骤
|
// 克隆步骤
|
||||||
public function addAction()
|
public function addAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
@ -145,7 +139,6 @@ class StepController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查看步骤信息
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
$gets = Request::all();
|
$gets = Request::all();
|
||||||
|
@ -153,7 +146,6 @@ class StepController extends DefaultController
|
||||||
return $this->json($row, true);
|
return $this->json($row, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存步骤
|
|
||||||
public function saveAction()
|
public function saveAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
@ -384,10 +376,6 @@ class StepController extends DefaultController
|
||||||
return json_encode($rows);
|
return json_encode($rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除步骤
|
|
||||||
*/
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id');
|
$id = Request::get('id');
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
<form method="post" class="form-horizontal" action="{{url('store')}}" id="mail" name="mail">
|
|
||||||
|
|
||||||
<table class="table table-form m-b-none">
|
|
||||||
<tr>
|
|
||||||
<td align="right" width="10%">名称</td>
|
|
||||||
<td align="left">
|
|
||||||
<input class="form-control input-sm" type="text" name="name" value="{{$row['name']}}">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">邮箱帐号</td>
|
|
||||||
<td align="left">
|
|
||||||
<input class="form-control input-sm" type="text" name="user" value="{{$row['user']}}">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">邮箱密码</td>
|
|
||||||
<td align="left">
|
|
||||||
<input class="form-control input-sm" type="text" name="password" value="{{$row['password']}}">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">SMTP服务器</td>
|
|
||||||
<td align="left">
|
|
||||||
<input class="form-control input-sm" type="text" name="smtp" value="{{$row['smtp']}}">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">服务器端口</td>
|
|
||||||
<td align="left">
|
|
||||||
<input class="form-control input-sm" type="text" name="port" value="{{$row['port']}}">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">连接方式</td>
|
|
||||||
<td align="left">
|
|
||||||
<select class="form-control input-sm" name="secure" id="secure">
|
|
||||||
<option value="" @if($row['secure'] == '') selected @endif>默认</option>
|
|
||||||
<option value="ssl" @if($row['secure'] == 'ssl') selected @endif>ssl</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">状态</td>
|
|
||||||
<td align="left">
|
|
||||||
<select class="form-control input-sm" name="status" id="status">
|
|
||||||
<option value="1" @if($row['status'] == '1') selected @endif>启用</option>
|
|
||||||
<option value="0" @if($row['status'] == '0') selected @endif>停用</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="right">排序</td>
|
|
||||||
<td align="left">
|
|
||||||
<input class="form-control input-sm" type="text" name="sort" value="{{$row['sort']}}">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<input type="hidden" name="id" value="{{$row['id']}}">
|
|
||||||
</form>
|
|
|
@ -70,7 +70,6 @@ class LogisticsController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -80,19 +79,16 @@ class LogisticsController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
@ -101,18 +97,15 @@ class LogisticsController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$search = search_form([
|
$search = search_form([
|
||||||
'advanced' => '',
|
'advanced' => '',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
'offset' => '',
|
'offset' => '',
|
||||||
'sort' => '',
|
'sort' => '',
|
||||||
'order' => '',
|
'order' => '',
|
||||||
'limit' => '',
|
'limit' => '',
|
||||||
], [
|
], [
|
||||||
['text','logistics.name','名称'],
|
['text','logistics.name','名称'],
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -45,9 +45,6 @@ class OrderController extends WorkflowController
|
||||||
'serviceCustomerMoney',
|
'serviceCustomerMoney',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单列表
|
|
||||||
*/
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
// 客户权限
|
// 客户权限
|
||||||
|
@ -61,19 +58,6 @@ class OrderController extends WorkflowController
|
||||||
|
|
||||||
$search = $header['search_form'];
|
$search = $header['search_form'];
|
||||||
$query = $search['query'];
|
$query = $search['query'];
|
||||||
|
|
||||||
$search['forms']['field'][] = 'acc_audit_date';
|
|
||||||
$search['forms']['condition'][] = '';
|
|
||||||
$search['forms']['search'][] = '';
|
|
||||||
$search['forms']['option'][] = [];
|
|
||||||
$search['columns'][] = [
|
|
||||||
'form_type' => 'date',
|
|
||||||
'field' => 'acc_audit_date',
|
|
||||||
'name' => '销售会计审核日期',
|
|
||||||
'options' => [],
|
|
||||||
];
|
|
||||||
$header['search_form'] = $search;
|
|
||||||
|
|
||||||
$cols = $header['cols'];
|
$cols = $header['cols'];
|
||||||
|
|
||||||
// 自定义列
|
// 自定义列
|
||||||
|
@ -259,17 +243,7 @@ class OrderController extends WorkflowController
|
||||||
|
|
||||||
foreach ($search['where'] as $where) {
|
foreach ($search['where'] as $where) {
|
||||||
if ($where['active']) {
|
if ($where['active']) {
|
||||||
if ($where['field'] == 'acc_audit_date') {
|
$model->search($where);
|
||||||
// 销售会计审核日期
|
|
||||||
$model->leftJoin(DB::raw("(select max(d.updated_at) as audit_date, m.data_id
|
|
||||||
FROM model_run_log as d left join model_run as m on d.run_id = m.id where m.bill_id = 23 and d.run_name = '销售会计'
|
|
||||||
GROUP BY m.data_id
|
|
||||||
) as l
|
|
||||||
"), 'l.data_id', '=', 'customer_order.id')
|
|
||||||
->whereRaw('('.sql_year_month('l.audit_date', 'ts').' = ?)', [$where['search']]);
|
|
||||||
} else {
|
|
||||||
$model->search($where);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -708,7 +682,6 @@ class OrderController extends WorkflowController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建促销
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -731,19 +704,16 @@ class OrderController extends WorkflowController
|
||||||
return $this->display(['form' => $form], $tpl);
|
return $this->display(['form' => $form], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑促销
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
|
@ -770,7 +740,6 @@ class OrderController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id');
|
$id = Request::get('id');
|
||||||
|
@ -809,9 +778,6 @@ class OrderController extends WorkflowController
|
||||||
return $print_type == 'pdf' ? print_prince($tpl) : $tpl;
|
return $print_type == 'pdf' ? print_prince($tpl) : $tpl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -1174,9 +1140,6 @@ class OrderController extends WorkflowController
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单删除
|
|
||||||
*/
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -20,7 +20,6 @@ class SampleApplyController extends WorkflowController
|
||||||
{
|
{
|
||||||
public $permission = ['dialog', 'serviceDelivery'];
|
public $permission = ['dialog', 'serviceDelivery'];
|
||||||
|
|
||||||
// 列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -86,7 +85,7 @@ class SampleApplyController extends WorkflowController
|
||||||
|
|
||||||
$model->select($header['select']);
|
$model->select($header['select']);
|
||||||
|
|
||||||
// 发货统计
|
// 明细统计
|
||||||
$model->leftJoin(DB::raw('(select SUM(ISNULL(d.money, 0)) money, SUM(ISNULL(d.quantity, 0)) quantity, d.sample_id
|
$model->leftJoin(DB::raw('(select SUM(ISNULL(d.money, 0)) money, SUM(ISNULL(d.quantity, 0)) quantity, d.sample_id
|
||||||
FROM sample_apply_data as d
|
FROM sample_apply_data as d
|
||||||
GROUP BY d.sample_id
|
GROUP BY d.sample_id
|
||||||
|
@ -118,7 +117,6 @@ class SampleApplyController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 明细列表
|
|
||||||
public function detailAction()
|
public function detailAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -182,7 +180,6 @@ class SampleApplyController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -197,25 +194,21 @@ class SampleApplyController extends WorkflowController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$this->layout = 'layouts.print2';
|
$this->layout = 'layouts.print2';
|
||||||
|
@ -227,7 +220,7 @@ class SampleApplyController extends WorkflowController
|
||||||
{
|
{
|
||||||
$gets = Request::all();
|
$gets = Request::all();
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
$rows = SampleApplyProduct::whereIn('id', $gets['ids'])->get();
|
$rows = SampleApply::whereIn('id', $gets['ids'])->get();
|
||||||
foreach($rows as $row) {
|
foreach($rows as $row) {
|
||||||
$row->use_close = $row->use_close == 1 ? 0 : 1;
|
$row->use_close = $row->use_close == 1 ? 0 : 1;
|
||||||
$row->save();
|
$row->save();
|
||||||
|
@ -287,7 +280,6 @@ class SampleApplyController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -69,7 +69,6 @@ class TypeController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -79,15 +78,11 @@ class TypeController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -126,7 +121,6 @@ class TypeController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -195,50 +195,6 @@ class WidgetController extends DefaultController
|
||||||
}
|
}
|
||||||
$res = $direct->get();
|
$res = $direct->get();
|
||||||
$rows[] = ['title' => '本月直营共发出 <span class="red">'.number_format($res->sum('count')).'</span> 张发货单,<span class="red">'.number_format($res->sum('quantity')).' </span>件,<span class="red">'.number_format($res->sum('money')).'</span> 元'];
|
$rows[] = ['title' => '本月直营共发出 <span class="red">'.number_format($res->sum('count')).'</span> 张发货单,<span class="red">'.number_format($res->sum('quantity')).' </span>件,<span class="red">'.number_format($res->sum('money')).'</span> 元'];
|
||||||
|
|
||||||
/*
|
|
||||||
// 订单审核状态。
|
|
||||||
$model = DB::table('customer_order')
|
|
||||||
->leftJoin('customer', 'customer.id', '=', 'customer_order.customer_id')
|
|
||||||
->selectRaw('sum(l.xshj_num) AS xshj_num, sum(l.sqjl_num) AS sqjl_num');
|
|
||||||
|
|
||||||
// 销售会计审核日期
|
|
||||||
$model->leftJoin(DB::raw("(select
|
|
||||||
m.data_id,
|
|
||||||
sum(case when d.run_name = '销售会计' then 1 else 0 end) as xshj_num,
|
|
||||||
sum(case when d.run_name = '省区经理' then 1 else 0 end) as sqjl_num
|
|
||||||
FROM model_run_log as d left join model_run as m on d.run_id = m.id where m.bill_id = 23 and d.updated_id = 0 and d.[option] = 1
|
|
||||||
GROUP BY m.data_id
|
|
||||||
) as l
|
|
||||||
"), 'l.data_id', '=', 'customer_order.id');
|
|
||||||
|
|
||||||
if ($region['authorise']) {
|
|
||||||
foreach ($region['whereIn'] as $key => $where) {
|
|
||||||
$model->whereIn($key, $where);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$res = $model->first();
|
|
||||||
$rows[] = ['title' => '订单待审核:销售会计<span class="red">'. $res['xshj_num'].'</span>张,省区经理<span class="red">'.$res['sqjl_num'].'</span>张'];
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
// 目前在途[]件。
|
|
||||||
$model = DB::table('customer_order')
|
|
||||||
->leftJoin('customer_order_data', 'customer_order_data.order_id', '=', 'customer_order.id')
|
|
||||||
->leftJoin('customer', 'customer.id', '=', 'customer_order.customer_id')
|
|
||||||
->whereRaw('FROM_UNIXTIME(customer_order.created_at,"%Y") BETWEEN '.$lastYear.' AND '.$nowYear)
|
|
||||||
->where('customer_order.delivery_time', '>', 0)
|
|
||||||
->where('customer_order.arrival_time', 0)
|
|
||||||
->selectRaw('SUM(customer_order_data.amount) AS amount');
|
|
||||||
|
|
||||||
if ($region['authorise']) {
|
|
||||||
foreach ($region['whereIn'] as $key => $where) {
|
|
||||||
$model->whereIn($key, $where);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$res = $model->first();
|
|
||||||
$rows[] = ['title' => '目前在途订单 <span class="red">'.(int)$res['amount'].'</span> 件'];
|
|
||||||
*/
|
|
||||||
|
|
||||||
$json['total'] = sizeof($rows);
|
$json['total'] = sizeof($rows);
|
||||||
$json['data'] = $rows;
|
$json['data'] = $rows;
|
||||||
|
|
|
@ -51,7 +51,7 @@ class OrderService
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取为使用的促销id
|
* 获取销售未发订单
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function getSaleOrderDataSql()
|
public static function getSaleOrderDataSql()
|
||||||
|
@ -131,7 +131,7 @@ class OrderService
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取为使用的促销id
|
* 获取销售订单未发货
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function getSaleOrderSelectDetailNotDeliverySql()
|
public static function getSaleOrderSelectDetailNotDeliverySql()
|
||||||
|
@ -174,7 +174,7 @@ class OrderService
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取为使用的促销id
|
* 获取销售订单发货表
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function getSaleOrderSelectDetailSql()
|
public static function getSaleOrderSelectDetailSql()
|
||||||
|
@ -235,7 +235,7 @@ class OrderService
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取为使用的促销id
|
* 获取销售订单调拨发货
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function getSaleOrderSelectDetailReqSql()
|
public static function getSaleOrderSelectDetailReqSql()
|
||||||
|
@ -331,7 +331,7 @@ class OrderService
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取为使用的促销id
|
* 获取赠品其他出库单明细
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function getSampleSelectDetailSql()
|
public static function getSampleSelectDetailSql()
|
||||||
|
|
|
@ -77,7 +77,6 @@ class MaterialController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -87,7 +86,6 @@ class MaterialController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
|
@ -275,7 +273,6 @@ class MaterialController extends DefaultController
|
||||||
return $this->json('配方保存成功。', true);
|
return $this->json('配方保存成功。', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
@ -284,9 +281,6 @@ class MaterialController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$search = search_form([
|
$search = search_form([
|
||||||
|
|
|
@ -59,7 +59,6 @@ class PlanController extends WorkflowController
|
||||||
}
|
}
|
||||||
|
|
||||||
$header['buttons'] = [
|
$header['buttons'] = [
|
||||||
//['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
|
|
||||||
['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
|
['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -167,7 +166,6 @@ class PlanController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -177,19 +175,16 @@ class PlanController extends WorkflowController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
|
@ -211,7 +206,6 @@ class PlanController extends WorkflowController
|
||||||
return $this->json($rows, true);
|
return $this->json($rows, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -7,13 +7,11 @@ use Gdoo\Stock\Services\StockService;
|
||||||
class ProduceService
|
class ProduceService
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 获取开票单位锁定金额
|
* 获取生产计划
|
||||||
*
|
*
|
||||||
* @i_UserID
|
* @date 日期
|
||||||
* @i_UserName
|
* @department_id 车间
|
||||||
*@i_Date 日期
|
* @isCalAgain 是否重新计算
|
||||||
* @i_DeptId 车间
|
|
||||||
* @i_IsCalAgain 是否重新计算
|
|
||||||
*/
|
*/
|
||||||
public static function getMaterialPlanDay($date, $department_id, $isCalAgain)
|
public static function getMaterialPlanDay($date, $department_id, $isCalAgain)
|
||||||
{
|
{
|
||||||
|
|
|
@ -70,7 +70,6 @@ class CategoryController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -80,28 +79,11 @@ class CategoryController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示客户联系人
|
|
||||||
public function showAction()
|
|
||||||
{
|
|
||||||
$id = (int)Request::get('id');
|
|
||||||
$group = ProductCategory::find($id);
|
|
||||||
$options = [
|
|
||||||
'table' => 'product_category',
|
|
||||||
'row' => $group,
|
|
||||||
];
|
|
||||||
$tpl = Form::show($options);
|
|
||||||
return $this->display([
|
|
||||||
'tpl' => $tpl,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -91,7 +91,6 @@ class ProductController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -101,13 +100,11 @@ class ProductController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示客户联系人
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -127,9 +124,6 @@ class ProductController extends DefaultController
|
||||||
return $this->render(['tips' => $tips], 'layouts.import');
|
return $this->render(['tips' => $tips], 'layouts.import');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -281,27 +275,11 @@ class ProductController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除产品
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
$ids = Request::get('id');
|
$ids = Request::get('id');
|
||||||
return Form::remove(['code' => 'product', 'ids' => $ids]);
|
return Form::remove(['code' => 'product', 'ids' => $ids]);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
$id = Request::get('id');
|
|
||||||
if (empty($id)) {
|
|
||||||
return $this->error('最少选择一行记录。');
|
|
||||||
}
|
|
||||||
|
|
||||||
$products = DB::table('product')->whereIn('id', $id)->get();
|
|
||||||
foreach ($products as $product) {
|
|
||||||
// 删除图片
|
|
||||||
image_delete($product['image']);
|
|
||||||
}
|
|
||||||
// 删除数据
|
|
||||||
DB::table('product')->whereIn('id', $id)->delete();
|
|
||||||
*/
|
|
||||||
return $this->json('恭喜你,产品删除成功。', url_referer('index'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,9 +38,7 @@ class UnitController extends DefaultController
|
||||||
foreach ($header['join'] as $join) {
|
foreach ($header['join'] as $join) {
|
||||||
$model->leftJoin($join[0], $join[1], $join[2], $join[3]);
|
$model->leftJoin($join[0], $join[1], $join[2], $join[3]);
|
||||||
}
|
}
|
||||||
$model
|
$model->orderBy('code', 'asc');
|
||||||
//->orderBy($header['sort'], $header['order'])
|
|
||||||
->orderBy('code', 'asc');
|
|
||||||
|
|
||||||
foreach ($search['where'] as $where) {
|
foreach ($search['where'] as $where) {
|
||||||
if ($where['active']) {
|
if ($where['active']) {
|
||||||
|
@ -68,7 +66,6 @@ class UnitController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -78,27 +75,11 @@ class UnitController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示客户联系人
|
|
||||||
public function showAction()
|
|
||||||
{
|
|
||||||
$id = (int)Request::get('id');
|
|
||||||
$group = ProductUnit::find($id);
|
|
||||||
$options = [
|
|
||||||
'table' => 'warehouse',
|
|
||||||
'row' => $group,
|
|
||||||
];
|
|
||||||
$tpl = Form::show($options);
|
|
||||||
return $this->display([
|
|
||||||
'tpl' => $tpl,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$search = search_form([], [
|
$search = search_form([], [
|
||||||
|
@ -121,7 +102,6 @@ class UnitController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -75,7 +75,7 @@ class ProjectController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 项目显示
|
// 项目详情
|
||||||
public function showAction(Request $request)
|
public function showAction(Request $request)
|
||||||
{
|
{
|
||||||
return $this->display([]);
|
return $this->display([]);
|
||||||
|
|
|
@ -14,6 +14,8 @@ use Gdoo\Project\Models\Item;
|
||||||
use Gdoo\Project\Models\Log;
|
use Gdoo\Project\Models\Log;
|
||||||
use Gdoo\Index\Models\Attachment;
|
use Gdoo\Index\Models\Attachment;
|
||||||
|
|
||||||
|
use Gdoo\Project\Services\TaskService;
|
||||||
|
|
||||||
use Gdoo\Index\Controllers\DefaultController;
|
use Gdoo\Index\Controllers\DefaultController;
|
||||||
use Gdoo\Index\Services\AttachmentService;
|
use Gdoo\Index\Services\AttachmentService;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
|
@ -36,7 +38,7 @@ class TaskController extends DefaultController
|
||||||
$query = $search['query'];
|
$query = $search['query'];
|
||||||
|
|
||||||
if ($request->ajax() && $request->wantsJson()) {
|
if ($request->ajax() && $request->wantsJson()) {
|
||||||
$tasks = $this->data($search);
|
$tasks = TaskService::data($search);
|
||||||
$_tasks = array_nest($tasks, 'name');
|
$_tasks = array_nest($tasks, 'name');
|
||||||
$rows = [];
|
$rows = [];
|
||||||
foreach($_tasks as $_task) {
|
foreach($_tasks as $_task) {
|
||||||
|
@ -47,7 +49,7 @@ class TaskController extends DefaultController
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->ajax()) {
|
if ($request->ajax()) {
|
||||||
$tasks = $this->data($search);
|
$tasks = TaskService::data($search);
|
||||||
return response()->json(['data' => $tasks]);
|
return response()->json(['data' => $tasks]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,114 +75,6 @@ class TaskController extends DefaultController
|
||||||
], 'index/'.$query['tpl']);
|
], 'index/'.$query['tpl']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取数据
|
|
||||||
public function data($search)
|
|
||||||
{
|
|
||||||
$query = $search['query'];
|
|
||||||
|
|
||||||
$user_id = auth()->id();
|
|
||||||
|
|
||||||
$_items = Task::where('project_id', $query['project_id'])
|
|
||||||
->leftJoin('project', 'project.id', '=', 'project_task.project_id')
|
|
||||||
->where('parent_id', 0)
|
|
||||||
->orderBy('project_task.sort', 'asc')
|
|
||||||
->orderBy('project_task.id', 'asc')
|
|
||||||
->get(['project_task.*', 'project.user_id as project_user_id'])->toArray();
|
|
||||||
|
|
||||||
$model = Task::with(['users' => function ($q) {
|
|
||||||
$q->select(['user.id','user.name as user_name']);
|
|
||||||
}]);
|
|
||||||
|
|
||||||
$model->where('project_task.project_id', $query['project_id'])
|
|
||||||
->leftJoin('project', 'project.id', '=', 'project_task.project_id')
|
|
||||||
->leftJoin('user', 'user.id', '=', 'project_task.user_id')
|
|
||||||
->where('parent_id', '>', 0);
|
|
||||||
|
|
||||||
foreach ($search['where'] as $where) {
|
|
||||||
if ($where['active']) {
|
|
||||||
$model->search($where);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$_tasks = $model->select(['project_task.*','user.name as user_name', 'project.user_id as project_user_id'])
|
|
||||||
->orderBy('project_task.sort', 'asc')
|
|
||||||
->orderBy('project_task.id', 'asc')
|
|
||||||
->get()->toArray();
|
|
||||||
|
|
||||||
foreach ($_items as $_item) {
|
|
||||||
$project_user_id = 0;
|
|
||||||
if ($_item['project_user_id'] == $user_id) {
|
|
||||||
$project_user_id = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$tasks[] = [
|
|
||||||
'start_date' => '',
|
|
||||||
'parent_id' => 0,
|
|
||||||
'parent' => 0,
|
|
||||||
'duration' => '',
|
|
||||||
'loaded' => true,
|
|
||||||
'expanded' => true,
|
|
||||||
'id' => $_item['id'],
|
|
||||||
'name' => $_item['name'],
|
|
||||||
'type' => $_item['type'],
|
|
||||||
'created_at' => '',
|
|
||||||
'user_id' => 0,
|
|
||||||
'user_name' => '',
|
|
||||||
'open' => true,
|
|
||||||
'option_edit' => $project_user_id,
|
|
||||||
'option_delete' => $project_user_id,
|
|
||||||
'dhm' => '',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($_tasks as $_task) {
|
|
||||||
$project_user_id = $task_user_id = 0;
|
|
||||||
|
|
||||||
if ($_task['user_id'] == $user_id) {
|
|
||||||
$task_user_id = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 显示保存按钮
|
|
||||||
if ($_task['project_user_id'] == $user_id) {
|
|
||||||
$task_user_id = $project_user_id = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$_task['option_edit'] = $task_user_id;
|
|
||||||
$_task['option_delete'] = $project_user_id;
|
|
||||||
|
|
||||||
$_task['start_date'] = date('Y-m-d', $_task['start_at']);
|
|
||||||
$_task['name'] = $_task['name'];
|
|
||||||
$_task['parent'] = $_task['parent_id'];
|
|
||||||
$_task['users'] = join(',', Arr::pluck($_task['users'], 'user_name'));
|
|
||||||
$_task['open'] = true;
|
|
||||||
$_task['loaded'] = true;
|
|
||||||
$_task['expanded'] = true;
|
|
||||||
$_task['created_dt'] = format_datetime($_task['created_at']);
|
|
||||||
$_task['start_dt'] = format_datetime($_task['start_at']);
|
|
||||||
$_task['end_dt'] = format_datetime($_task['end_at']);
|
|
||||||
|
|
||||||
if ($_task['start_at'] && $_task['end_at']) {
|
|
||||||
$remain = remain_time($_task['start_at'], $_task['end_at'], '');
|
|
||||||
$str = '';
|
|
||||||
if ($remain->d) {
|
|
||||||
$str .= $remain->d.'天';
|
|
||||||
}
|
|
||||||
if ($remain->h) {
|
|
||||||
$str .= $remain->h.'小时';
|
|
||||||
}
|
|
||||||
if ($remain->i) {
|
|
||||||
$str .= $remain->i.'分钟';
|
|
||||||
}
|
|
||||||
$_task['duration_date'] = $str;
|
|
||||||
}
|
|
||||||
|
|
||||||
$_task['duration'] = ($_task['end_at'] - $_task['start_at']) / 86400;
|
|
||||||
$_task['duration'] = $_task['duration'] > 0 ? $_task['duration'] : 1;
|
|
||||||
|
|
||||||
$tasks[] = $_task;
|
|
||||||
}
|
|
||||||
return $tasks;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 显示任务
|
// 显示任务
|
||||||
public function showAction(Request $request)
|
public function showAction(Request $request)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
<?php namespace Gdoo\Project\Services;
|
<?php namespace Gdoo\Project\Services;
|
||||||
|
|
||||||
|
use Arr;
|
||||||
use DB;
|
use DB;
|
||||||
use Auth;
|
use Auth;
|
||||||
|
use Gdoo\Project\Models\Task;
|
||||||
|
|
||||||
class TaskService
|
class TaskService
|
||||||
{
|
{
|
||||||
|
@ -18,4 +20,111 @@ class TaskService
|
||||||
$ret['data'] = $rows;
|
$ret['data'] = $rows;
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 读取数据
|
||||||
|
public static function data($search)
|
||||||
|
{
|
||||||
|
$query = $search['query'];
|
||||||
|
$user_id = auth()->id();
|
||||||
|
|
||||||
|
$_items = Task::where('project_id', $query['project_id'])
|
||||||
|
->leftJoin('project', 'project.id', '=', 'project_task.project_id')
|
||||||
|
->where('parent_id', 0)
|
||||||
|
->orderBy('project_task.sort', 'asc')
|
||||||
|
->orderBy('project_task.id', 'asc')
|
||||||
|
->get(['project_task.*', 'project.user_id as project_user_id'])->toArray();
|
||||||
|
|
||||||
|
$model = Task::with(['users' => function ($q) {
|
||||||
|
$q->select(['user.id','user.name as user_name']);
|
||||||
|
}]);
|
||||||
|
|
||||||
|
$model->where('project_task.project_id', $query['project_id'])
|
||||||
|
->leftJoin('project', 'project.id', '=', 'project_task.project_id')
|
||||||
|
->leftJoin('user', 'user.id', '=', 'project_task.user_id')
|
||||||
|
->where('parent_id', '>', 0);
|
||||||
|
|
||||||
|
foreach ($search['where'] as $where) {
|
||||||
|
if ($where['active']) {
|
||||||
|
$model->search($where);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$_tasks = $model->select(['project_task.*','user.name as user_name', 'project.user_id as project_user_id'])
|
||||||
|
->orderBy('project_task.sort', 'asc')
|
||||||
|
->orderBy('project_task.id', 'asc')
|
||||||
|
->get()->toArray();
|
||||||
|
|
||||||
|
foreach ($_items as $_item) {
|
||||||
|
$project_user_id = 0;
|
||||||
|
if ($_item['project_user_id'] == $user_id) {
|
||||||
|
$project_user_id = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tasks[] = [
|
||||||
|
'start_date' => '',
|
||||||
|
'parent_id' => 0,
|
||||||
|
'parent' => 0,
|
||||||
|
'duration' => '',
|
||||||
|
'loaded' => true,
|
||||||
|
'expanded' => true,
|
||||||
|
'id' => $_item['id'],
|
||||||
|
'name' => $_item['name'],
|
||||||
|
'type' => $_item['type'],
|
||||||
|
'created_at' => '',
|
||||||
|
'user_id' => 0,
|
||||||
|
'user_name' => '',
|
||||||
|
'open' => true,
|
||||||
|
'option_edit' => $project_user_id,
|
||||||
|
'option_delete' => $project_user_id,
|
||||||
|
'dhm' => '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($_tasks as $_task) {
|
||||||
|
$project_user_id = $task_user_id = 0;
|
||||||
|
|
||||||
|
if ($_task['user_id'] == $user_id) {
|
||||||
|
$task_user_id = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示保存按钮
|
||||||
|
if ($_task['project_user_id'] == $user_id) {
|
||||||
|
$task_user_id = $project_user_id = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$_task['option_edit'] = $task_user_id;
|
||||||
|
$_task['option_delete'] = $project_user_id;
|
||||||
|
|
||||||
|
$_task['start_date'] = date('Y-m-d', $_task['start_at']);
|
||||||
|
$_task['name'] = $_task['name'];
|
||||||
|
$_task['parent'] = $_task['parent_id'];
|
||||||
|
$_task['users'] = join(',', Arr::pluck($_task['users'], 'user_name'));
|
||||||
|
$_task['open'] = true;
|
||||||
|
$_task['loaded'] = true;
|
||||||
|
$_task['expanded'] = true;
|
||||||
|
$_task['created_dt'] = format_datetime($_task['created_at']);
|
||||||
|
$_task['start_dt'] = format_datetime($_task['start_at']);
|
||||||
|
$_task['end_dt'] = format_datetime($_task['end_at']);
|
||||||
|
|
||||||
|
if ($_task['start_at'] && $_task['end_at']) {
|
||||||
|
$remain = remain_time($_task['start_at'], $_task['end_at'], '');
|
||||||
|
$str = '';
|
||||||
|
if ($remain->d) {
|
||||||
|
$str .= $remain->d.'天';
|
||||||
|
}
|
||||||
|
if ($remain->h) {
|
||||||
|
$str .= $remain->h.'小时';
|
||||||
|
}
|
||||||
|
if ($remain->i) {
|
||||||
|
$str .= $remain->i.'分钟';
|
||||||
|
}
|
||||||
|
$_task['duration_date'] = $str;
|
||||||
|
}
|
||||||
|
|
||||||
|
$_task['duration'] = ($_task['end_at'] - $_task['start_at']) / 86400;
|
||||||
|
$_task['duration'] = $_task['duration'] > 0 ? $_task['duration'] : 1;
|
||||||
|
|
||||||
|
$tasks[] = $_task;
|
||||||
|
}
|
||||||
|
return $tasks;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -14,13 +14,12 @@ use Gdoo\Model\Grid;
|
||||||
use Gdoo\Model\Form;
|
use Gdoo\Model\Form;
|
||||||
|
|
||||||
use Gdoo\Index\Controllers\DefaultController;
|
use Gdoo\Index\Controllers\DefaultController;
|
||||||
use Exception;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class MaterialController extends DefaultController
|
class MaterialController extends DefaultController
|
||||||
{
|
{
|
||||||
public $permission = ['detail', 'dialog', 'store', 'archive', 'download'];
|
public $permission = ['detail', 'dialog', 'store', 'archive', 'download'];
|
||||||
|
|
||||||
// 促销核销列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
// 客户权限
|
// 客户权限
|
||||||
|
@ -104,7 +103,6 @@ class MaterialController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 促销核销明细
|
|
||||||
public function detailAction()
|
public function detailAction()
|
||||||
{
|
{
|
||||||
$search = search_form([
|
$search = search_form([
|
||||||
|
@ -171,7 +169,6 @@ class MaterialController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取核销列表
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
@ -191,7 +188,6 @@ class MaterialController extends DefaultController
|
||||||
return $this->json($rows, true);
|
return $this->json($rows, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id');
|
$id = Request::get('id');
|
||||||
|
@ -221,7 +217,6 @@ class MaterialController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 促销核销审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
$id = (array)Request::get('id');
|
$id = (array)Request::get('id');
|
||||||
|
@ -238,7 +233,6 @@ class MaterialController extends DefaultController
|
||||||
return $this->json('操作成功。', true);
|
return $this->json('操作成功。', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 促销核销审核
|
|
||||||
public function archiveAction()
|
public function archiveAction()
|
||||||
{
|
{
|
||||||
$id = (array)Request::get('id');
|
$id = (array)Request::get('id');
|
||||||
|
@ -264,7 +258,6 @@ class MaterialController extends DefaultController
|
||||||
return $this->json('', true);
|
return $this->json('', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 促销核销审核
|
|
||||||
public function downloadAction()
|
public function downloadAction()
|
||||||
{
|
{
|
||||||
$sn = Request::get('sn');
|
$sn = Request::get('sn');
|
||||||
|
@ -301,7 +294,7 @@ class MaterialController extends DefaultController
|
||||||
// 文件后缀名
|
// 文件后缀名
|
||||||
$extension = $image->getClientOriginalExtension();
|
$extension = $image->getClientOriginalExtension();
|
||||||
// 文件新名字
|
// 文件新名字
|
||||||
$filename = date('dhis_').str_random(4).'.'.$extension;
|
$filename = date('dhis_').Str::random(4).'.'.$extension;
|
||||||
$filename = mb_strtolower($filename);
|
$filename = mb_strtolower($filename);
|
||||||
if ($image->move($upload_path, $filename)) {
|
if ($image->move($upload_path, $filename)) {
|
||||||
|
|
||||||
|
@ -329,7 +322,6 @@ class MaterialController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除核销
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -114,7 +114,6 @@ class PromotionController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建促销
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -142,25 +141,21 @@ class PromotionController extends WorkflowController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑促销
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核促销
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -300,14 +295,6 @@ class PromotionController extends WorkflowController
|
||||||
$model->orderBy($query['sort'], $query['order']);
|
$model->orderBy($query['sort'], $query['order']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
'17' as fee_src_type_id,
|
|
||||||
'6' as fee_category_id,
|
|
||||||
'赠品' as fee_category_id_name,
|
|
||||||
'2' as type_id,
|
|
||||||
'赠品' as type_id_name
|
|
||||||
*/
|
|
||||||
|
|
||||||
$rows = $model->get();
|
$rows = $model->get();
|
||||||
$rows->transform(function ($row) {
|
$rows->transform(function ($row) {
|
||||||
// 赠品
|
// 赠品
|
||||||
|
@ -377,7 +364,6 @@ class PromotionController extends WorkflowController
|
||||||
return $this->json($count, true);
|
return $this->json($count, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 核销对话框
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$search = search_form(
|
$search = search_form(
|
||||||
|
@ -513,7 +499,6 @@ class PromotionController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除促销
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -82,7 +82,6 @@ class ReviewController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建促销
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -107,25 +106,21 @@ class ReviewController extends WorkflowController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑促销
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核促销
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$this->layout = 'layouts.print2';
|
$this->layout = 'layouts.print2';
|
||||||
|
@ -164,7 +159,6 @@ class ReviewController extends WorkflowController
|
||||||
return $this->render(['query' => $query]);
|
return $this->render(['query' => $query]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除促销
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -69,7 +69,6 @@ class OrderController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -79,19 +78,16 @@ class OrderController extends WorkflowController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
|
@ -191,7 +187,6 @@ class OrderController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -70,7 +70,6 @@ class SupplierController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -80,27 +79,21 @@ class SupplierController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('edit');
|
return $this->createAction('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$search = search_form(
|
$search = search_form(
|
||||||
|
@ -138,7 +131,6 @@ class SupplierController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -18,7 +18,6 @@ class AllocationController extends WorkflowController
|
||||||
{
|
{
|
||||||
public $permission = ['dialog', 'logistics', 'stockSelect'];
|
public $permission = ['dialog', 'logistics', 'stockSelect'];
|
||||||
|
|
||||||
// 列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -72,7 +71,6 @@ class AllocationController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -87,25 +85,21 @@ class AllocationController extends WorkflowController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id');
|
$id = Request::get('id');
|
||||||
|
@ -138,17 +132,10 @@ class AllocationController extends WorkflowController
|
||||||
'template' => DB::table('model_template')->where('id', $template_id)->first()
|
'template' => DB::table('model_template')->where('id', $template_id)->first()
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($master['in_warehouse_code'] == 27 || $master['in_warehouse_code'] == 21) {
|
|
||||||
$warehouse_by = '李志全';
|
|
||||||
} else {
|
|
||||||
$warehouse_by = '万海英';
|
|
||||||
}
|
|
||||||
|
|
||||||
$tpl = $this->display([
|
$tpl = $this->display([
|
||||||
'master' => $master,
|
'master' => $master,
|
||||||
'rows' => $rows,
|
'rows' => $rows,
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
'warehouse_by' => $warehouse_by,
|
|
||||||
], 'print/'.$template_id);
|
], 'print/'.$template_id);
|
||||||
return $tpl;
|
return $tpl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@ class CancelController extends WorkflowController
|
||||||
{
|
{
|
||||||
public $permission = ['dialog'];
|
public $permission = ['dialog'];
|
||||||
|
|
||||||
// 列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -74,7 +73,6 @@ class CancelController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -89,25 +87,21 @@ class CancelController extends WorkflowController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id');
|
$id = Request::get('id');
|
||||||
|
@ -174,7 +168,6 @@ class CancelController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -68,7 +68,6 @@ class CategoryController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -78,15 +77,11 @@ class CategoryController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -123,7 +118,6 @@ class CategoryController extends DefaultController
|
||||||
], 'dialog');
|
], 'dialog');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -33,7 +33,6 @@ class DeliveryController extends WorkflowController
|
||||||
'autoSave'
|
'autoSave'
|
||||||
];
|
];
|
||||||
|
|
||||||
// 发货列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -115,7 +114,6 @@ class DeliveryController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 明细列表
|
|
||||||
public function detailAction()
|
public function detailAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -185,7 +183,6 @@ class DeliveryController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 自动保存
|
|
||||||
public function autoSaveAction()
|
public function autoSaveAction()
|
||||||
{
|
{
|
||||||
$gets = Request::all();
|
$gets = Request::all();
|
||||||
|
@ -245,7 +242,6 @@ class DeliveryController extends WorkflowController
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -269,19 +265,16 @@ class DeliveryController extends WorkflowController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
|
@ -308,7 +301,6 @@ class DeliveryController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id');
|
$id = Request::get('id');
|
||||||
|
@ -430,7 +422,6 @@ class DeliveryController extends WorkflowController
|
||||||
], 'getBatchSelect');
|
], 'getBatchSelect');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -16,7 +16,6 @@ class DirectController extends WorkflowController
|
||||||
{
|
{
|
||||||
public $permission = ['dialog', 'importExcel'];
|
public $permission = ['dialog', 'importExcel'];
|
||||||
|
|
||||||
// 列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -69,7 +68,6 @@ class DirectController extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -84,25 +82,21 @@ class DirectController extends WorkflowController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id');
|
$id = Request::get('id');
|
||||||
|
@ -236,7 +230,6 @@ class DirectController extends WorkflowController
|
||||||
return view('importExcel');
|
return view('importExcel');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -68,7 +68,6 @@ class LocationController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -78,15 +77,11 @@ class LocationController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -177,7 +172,6 @@ class LocationController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -16,7 +16,6 @@ class Record01Controller extends AuditController
|
||||||
{
|
{
|
||||||
public $permission = ['dialog'];
|
public $permission = ['dialog'];
|
||||||
|
|
||||||
// 列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -70,7 +69,6 @@ class Record01Controller extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -85,26 +83,22 @@ class Record01Controller extends AuditController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$this->layout = 'layouts.print2';
|
$this->layout = 'layouts.print2';
|
||||||
print_prince($this->createAction('print'));
|
print_prince($this->createAction('print'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -16,7 +16,6 @@ class Record08Controller extends AuditController
|
||||||
{
|
{
|
||||||
public $permission = ['dialog', 'importExcel'];
|
public $permission = ['dialog', 'importExcel'];
|
||||||
|
|
||||||
// 列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -70,7 +69,6 @@ class Record08Controller extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -85,19 +83,16 @@ class Record08Controller extends AuditController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$this->layout = 'layouts.print2';
|
$this->layout = 'layouts.print2';
|
||||||
|
@ -155,7 +150,6 @@ class Record08Controller extends AuditController
|
||||||
return view('importExcel');
|
return view('importExcel');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -16,7 +16,6 @@ class Record09Controller extends WorkflowController
|
||||||
{
|
{
|
||||||
public $permission = ['dialog'];
|
public $permission = ['dialog'];
|
||||||
|
|
||||||
// 列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -70,7 +69,6 @@ class Record09Controller extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -85,25 +83,21 @@ class Record09Controller extends WorkflowController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id');
|
$id = Request::get('id');
|
||||||
|
@ -146,7 +140,6 @@ class Record09Controller extends WorkflowController
|
||||||
return $tpl;
|
return $tpl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -16,7 +16,6 @@ class Record10Controller extends WorkflowController
|
||||||
{
|
{
|
||||||
public $permission = ['dialog', 'print3'];
|
public $permission = ['dialog', 'print3'];
|
||||||
|
|
||||||
// 列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -43,15 +42,6 @@ class Record10Controller extends WorkflowController
|
||||||
}
|
}
|
||||||
$model->orderBy($header['sort'], $header['order']);
|
$model->orderBy($header['sort'], $header['order']);
|
||||||
|
|
||||||
/*
|
|
||||||
// 外部库管登录
|
|
||||||
if (auth()->id() == 2177) {
|
|
||||||
$model->whereIn('stock_record10.warehouse_id', [20001, 20047]);
|
|
||||||
} else {
|
|
||||||
$model->whereNotIn('stock_record10.warehouse_id', [20001, 20047]);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
foreach ($search['where'] as $where) {
|
foreach ($search['where'] as $where) {
|
||||||
if ($where['active']) {
|
if ($where['active']) {
|
||||||
$model->search($where);
|
$model->search($where);
|
||||||
|
@ -79,7 +69,6 @@ class Record10Controller extends WorkflowController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -95,25 +84,21 @@ class Record10Controller extends WorkflowController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
|
||||||
public function auditAction()
|
public function auditAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('audit');
|
return $this->createAction('audit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印
|
|
||||||
public function print2Action()
|
public function print2Action()
|
||||||
{
|
{
|
||||||
$this->layout = 'layouts.print2';
|
$this->layout = 'layouts.print2';
|
||||||
|
@ -122,7 +107,6 @@ class Record10Controller extends WorkflowController
|
||||||
print_prince($this->createAction('print'));
|
print_prince($this->createAction('print'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id');
|
$id = Request::get('id');
|
||||||
|
@ -172,101 +156,6 @@ class Record10Controller extends WorkflowController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示促销
|
|
||||||
public function print3Action()
|
|
||||||
{
|
|
||||||
$this->layout = 'layouts.print2';
|
|
||||||
$id = Request::get('id');
|
|
||||||
$template_id = Request::get('template_id');
|
|
||||||
if ($template_id == 117) {
|
|
||||||
|
|
||||||
$this->layout = 'layouts.print2';
|
|
||||||
|
|
||||||
$master = DB::table('stock_record10 as m')->where('m.id', $id)
|
|
||||||
->leftJoin('stock_type as st', 'st.id', '=', 'm.type_id')
|
|
||||||
->leftJoin('department', 'department.id', '=', 'm.department_id')
|
|
||||||
->leftJoin('warehouse', 'warehouse.id', '=', 'm.warehouse_id')
|
|
||||||
->selectRaw('m.*, st.name as type_name, warehouse.name as warehouse_name, department.name as department_name')
|
|
||||||
->first();
|
|
||||||
|
|
||||||
$rows = DB::table('stock_record10_data as d')
|
|
||||||
->leftJoin('stock_record10 as m', 'm.id', '=', 'd.record10_id')
|
|
||||||
->leftJoin('product as p', 'p.id', '=', 'd.product_id')
|
|
||||||
->leftJoin('product_unit as pu', 'pu.id', '=', 'p.unit_id')
|
|
||||||
->leftJoin('stock_type as st', 'st.id', '=', 'm.type_id')
|
|
||||||
->where('m.id', $id)
|
|
||||||
->selectRaw('
|
|
||||||
d.*,
|
|
||||||
p.name as product_name,
|
|
||||||
p.code as product_code,
|
|
||||||
p.spec as product_spec,
|
|
||||||
st.name as type_name,
|
|
||||||
pu.name as product_unit
|
|
||||||
')
|
|
||||||
->get();
|
|
||||||
|
|
||||||
$form = [
|
|
||||||
'template' => DB::table('model_template')->where('id', $template_id)->first()
|
|
||||||
];
|
|
||||||
|
|
||||||
$template = "report.fr3";
|
|
||||||
$ver = 3.0;
|
|
||||||
|
|
||||||
$id = (int) Request::get('id');
|
|
||||||
$header['action'] = 'print';
|
|
||||||
$header['code'] = 'stock_record10';
|
|
||||||
$header['id'] = $id;
|
|
||||||
$form = Form::make($header);
|
|
||||||
|
|
||||||
$Tables = [];
|
|
||||||
foreach($form['prints'] as $print) {
|
|
||||||
$fields = [];
|
|
||||||
foreach($print['fields'] as $field) {
|
|
||||||
$type = 'str';
|
|
||||||
$size = 255;
|
|
||||||
if ($field['type'] == 'INT' || $field['type'] == 'TINYINT') {
|
|
||||||
$type = 'int';
|
|
||||||
$size = 0;
|
|
||||||
}
|
|
||||||
if ($field['type'] == 'DATE') {
|
|
||||||
$type = 'str';
|
|
||||||
}
|
|
||||||
if ($field['type'] == 'DECIMAL') {
|
|
||||||
$type = 'float';
|
|
||||||
$size = 0;
|
|
||||||
}
|
|
||||||
$fields[] = ["type" => $type, "size" => $size, "name" => $field['field'], "required" => false];
|
|
||||||
}
|
|
||||||
$Tables[] = [
|
|
||||||
'Name' => $print['name'],
|
|
||||||
'Cols' => $fields,
|
|
||||||
'Data' => $print['data'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
$jsonObject = [
|
|
||||||
"template" => $template,
|
|
||||||
"ver" => $ver,
|
|
||||||
"Tables" => $Tables,
|
|
||||||
];
|
|
||||||
|
|
||||||
$jsonStr = json_encode($jsonObject);
|
|
||||||
|
|
||||||
|
|
||||||
$tpl = $this->display([
|
|
||||||
'master' => $master,
|
|
||||||
'jsonStr' => $jsonStr,
|
|
||||||
'rows' => $rows,
|
|
||||||
'form' => $form,
|
|
||||||
], 'print3/'.$template_id);
|
|
||||||
return $tpl;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$tpl = $this->createAction('print');
|
|
||||||
print_prince($tpl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -16,7 +16,6 @@ class Record11Controller extends AuditController
|
||||||
{
|
{
|
||||||
public $permission = ['dialog'];
|
public $permission = ['dialog'];
|
||||||
|
|
||||||
// 列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -69,7 +68,6 @@ class Record11Controller extends AuditController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建
|
|
||||||
public function createAction($action = 'edit')
|
public function createAction($action = 'edit')
|
||||||
{
|
{
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
|
@ -84,19 +82,16 @@ class Record11Controller extends AuditController
|
||||||
], $tpl);
|
], $tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
return $this->createAction('show');
|
return $this->createAction('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印
|
|
||||||
public function printAction()
|
public function printAction()
|
||||||
{
|
{
|
||||||
$id = Request::get('id');
|
$id = Request::get('id');
|
||||||
|
@ -147,7 +142,6 @@ class Record11Controller extends AuditController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -99,18 +99,6 @@ class ReportController extends DefaultController
|
||||||
}
|
}
|
||||||
$rows = [];
|
$rows = [];
|
||||||
if ($query['filter'] == 1) {
|
if ($query['filter'] == 1) {
|
||||||
/*
|
|
||||||
$rows = DB::select('EXEC P_ReportOrderStockTotal ?,?,?,?,?,?,?,?', [
|
|
||||||
$fields['warehouse_id'],
|
|
||||||
$fields['product_code'],
|
|
||||||
$fields['type'],
|
|
||||||
$fields['date'][0],
|
|
||||||
$fields['date'][1],
|
|
||||||
auth()->id(),
|
|
||||||
$fields['batch'],
|
|
||||||
$fields['bmj'],
|
|
||||||
]);
|
|
||||||
*/
|
|
||||||
$rows = StockService::reportOrderStockTotal(
|
$rows = StockService::reportOrderStockTotal(
|
||||||
$fields['warehouse_id'],
|
$fields['warehouse_id'],
|
||||||
$fields['product_code'],
|
$fields['product_code'],
|
||||||
|
|
|
@ -68,7 +68,6 @@ class TypeController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -78,15 +77,11 @@ class TypeController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -123,7 +118,6 @@ class TypeController extends DefaultController
|
||||||
], 'dialog');
|
], 'dialog');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -68,7 +68,6 @@ class WarehouseController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -78,15 +77,11 @@ class WarehouseController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹出层信息
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$header = Grid::header([
|
$header = Grid::header([
|
||||||
|
@ -166,7 +161,6 @@ class WarehouseController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
<table width="100%" style="LINE-HEIGHT:30px;font-size:11pt;" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
|
<table width="100%" style="LINE-HEIGHT:30px;font-size:11pt;" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
|
||||||
<tr>
|
<tr>
|
||||||
<td width="40%">制单人:{{$master['created_by']}}</td>
|
<td width="40%">制单人:{{$master['created_by']}}</td>
|
||||||
<td width="40%">库管员:{{$warehouse_by}}</td>
|
<td width="40%">库管员:</td>
|
||||||
<td width="20%" align="right">第<font tdata="PageNO">##</font>页,<font tdata="PageCount">##</font></span>页</td>
|
<td width="20%" align="right">第<font tdata="PageNO">##</font>页,<font tdata="PageCount">##</font></span>页</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
|
|
||||||
<div style="width: 100%;text-align:center;">
|
|
||||||
<h2>康虎云报表系统报表打印测试(Ver 1.2.2)</h2>
|
|
||||||
<h3>(PHP版演示)</h3>
|
|
||||||
<div>
|
|
||||||
点按下面的“打印”按钮开始打印<br/>
|
|
||||||
<input type="button" id="btnPrint" value="打印" onClick="doSend(_reportData);" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="readme">
|
|
||||||
说明:<br/>
|
|
||||||
通过修改本页源码中的下列参数控制本页的行为:<br/>
|
|
||||||
<script language="javascript" type="text/javascript"><br/>
|
|
||||||
<span style="color:green">/**下面四个参数必须放在myreport.js脚本后面,以覆盖myreport.js中的默认值**/</span><br/>
|
|
||||||
<span style="color:blue">var</span> _delay_send = <span style="color:red">1000</span>; <span style="color:green">//发送打印服务器前延时时长</span><br/>
|
|
||||||
<span style="color:blue">var</span> _delay_close = <span style="color:red">1000</span>; <span style="color:green">//打印完成后关闭窗口的延时时长, -1则表示不关闭</span><br/>
|
|
||||||
<span style="color:blue">var</span> cfprint_addr = <span style="color:red">"127.0.0.1"</span>; <span style="color:green">//打印服务器监听地址</span><br/>
|
|
||||||
<span style="color:blue">var</span> cfprint_port = <span style="color:red">54321</span>; <span style="color:green">//打印服务器监听端口</span><br/>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- 定义一个div用以显示实际发送给打印伺服程序的json,方便调试,-->
|
|
||||||
<div id="output"></div>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
<!--下面引入两个必须的 javascript 文件-->
|
|
||||||
<script language="javascript" type="text/javascript" src="{{$asset_url}}/vendor/cfprint/cfprint.min.js"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="{{$asset_url}}/vendor/cfprint/myreport.js"></script>
|
|
||||||
<!-- 下面重新设置几个参数,以覆盖myreport.js 中的默认值 -->
|
|
||||||
<script language="javascript" type="text/javascript">
|
|
||||||
/**下面四个参数必须放在myreport.js脚本后面,以覆盖myreport.js中的默认值**/
|
|
||||||
var _delay_send = -1; //发送打印服务器前延时时长, -1则表示不自动打印
|
|
||||||
var _delay_close = -1; //打印完成后关闭窗口的延时时长, -1则表示不关闭
|
|
||||||
var cfprint_addr = "127.0.0.1"; //打印服务器监听地址
|
|
||||||
var cfprint_port = 54321; //打印服务器监听端口
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
//把PHP代码里生成的数据json字符串转成javascript放在页面上,
|
|
||||||
//浏览器加载完该页面后会把该数据发送给康虎云报表伺服程序去打印
|
|
||||||
var _reportData = '<?php echo $jsonStr; ?>';
|
|
||||||
|
|
||||||
//在javascript控制台输出一下这个json字符串,对于调试有帮助
|
|
||||||
console.log("reportData = " + _reportData);
|
|
||||||
</script>
|
|
|
@ -187,9 +187,6 @@ class LogController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -180,13 +180,11 @@ class MailController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建邮箱帐号
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
return $this->editAction();
|
return $this->editAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑邮箱帐号
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -196,9 +194,6 @@ class MailController extends DefaultController
|
||||||
], 'edit');
|
], 'edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存
|
|
||||||
*/
|
|
||||||
public function storeAction()
|
public function storeAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
@ -224,9 +219,6 @@ class MailController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -8,6 +8,7 @@ use DB;
|
||||||
use Gdoo\System\Models\Media;
|
use Gdoo\System\Models\Media;
|
||||||
|
|
||||||
use Gdoo\Index\Controllers\DefaultController;
|
use Gdoo\Index\Controllers\DefaultController;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class MediaController extends DefaultController
|
class MediaController extends DefaultController
|
||||||
{
|
{
|
||||||
|
@ -29,9 +30,6 @@ class MediaController extends DefaultController
|
||||||
], 'qrcode');
|
], 'qrcode');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 新建文件
|
|
||||||
*/
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$folderId = Request::get('folder_id');
|
$folderId = Request::get('folder_id');
|
||||||
|
@ -50,7 +48,7 @@ class MediaController extends DefaultController
|
||||||
$extension = $file->getClientOriginalExtension();
|
$extension = $file->getClientOriginalExtension();
|
||||||
|
|
||||||
// 文件新名字
|
// 文件新名字
|
||||||
$filename = date('dhis_').str_random(4).'.'.$extension;
|
$filename = date('dhis_').Str::random(4).'.'.$extension;
|
||||||
$filename = mb_strtolower($filename);
|
$filename = mb_strtolower($filename);
|
||||||
|
|
||||||
$fileTypes = ['image/png', 'image/jpg', 'image/jpeg'];
|
$fileTypes = ['image/png', 'image/jpg', 'image/jpeg'];
|
||||||
|
@ -84,9 +82,6 @@ class MediaController extends DefaultController
|
||||||
return $this->json('文件上传失败');
|
return $this->json('文件上传失败');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件对话框
|
|
||||||
*/
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -12,7 +12,6 @@ use Gdoo\Index\Controllers\DefaultController;
|
||||||
|
|
||||||
class MenuController extends DefaultController
|
class MenuController extends DefaultController
|
||||||
{
|
{
|
||||||
// 菜单列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = [
|
$header = [
|
||||||
|
@ -163,73 +162,11 @@ class MenuController extends DefaultController
|
||||||
$header['search_form'] = $search;
|
$header['search_form'] = $search;
|
||||||
$header['js'] = Grid::js($header);
|
$header['js'] = Grid::js($header);
|
||||||
|
|
||||||
// 配置权限
|
|
||||||
return $this->display([
|
return $this->display([
|
||||||
'header' => $header,
|
'header' => $header,
|
||||||
]);
|
]);
|
||||||
/*
|
|
||||||
if (Request::method() == 'POST') {
|
|
||||||
$sorts = Request::get('sort');
|
|
||||||
foreach ($sorts as $id => $sort) {
|
|
||||||
DB::table('menu')->where('id', $id)->update(['sort' => $sort]);
|
|
||||||
}
|
|
||||||
tree_rebuild('menu');
|
|
||||||
return $this->success('index', '恭喜你,操作成功。');
|
|
||||||
}
|
|
||||||
|
|
||||||
$search = search_form([
|
|
||||||
'referer' => 1,
|
|
||||||
], []);
|
|
||||||
|
|
||||||
$rows = DB::table('menu')
|
|
||||||
->orderBy('lft', 'asc')
|
|
||||||
->get();
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
$rows = DB::table('dict')->get();
|
|
||||||
|
|
||||||
foreach ($rows as $key => $row) {
|
|
||||||
|
|
||||||
$values = json_decode($row['value'], true);
|
|
||||||
|
|
||||||
//$data['parent_id'] = $row['id'];
|
|
||||||
|
|
||||||
$id = DB::table('option')->insertGetId([
|
|
||||||
'parent_id' => 0,
|
|
||||||
'name' => $row['name'],
|
|
||||||
'value' => $row['key'],
|
|
||||||
]);
|
|
||||||
|
|
||||||
$data = [];
|
|
||||||
|
|
||||||
$data['parent_id'] = $id;
|
|
||||||
|
|
||||||
if($values) {
|
|
||||||
|
|
||||||
foreach ($values as $k => $v) {
|
|
||||||
|
|
||||||
$data['sort'] = $k;
|
|
||||||
$data['value'] = ''.$v['id'].'';
|
|
||||||
$data['name'] = ''.$v['name'].'';
|
|
||||||
DB::table('option')->insert($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print_r($rows);
|
|
||||||
exit;
|
|
||||||
*/
|
|
||||||
|
|
||||||
//$rows = array_nest($rows);
|
|
||||||
/*
|
|
||||||
return $this->display([
|
|
||||||
'rows' => $rows,
|
|
||||||
]);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建菜单
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -271,7 +208,6 @@ class MenuController extends DefaultController
|
||||||
return $this->editAction();
|
return $this->editAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除菜单
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -14,7 +14,6 @@ class OptionController extends DefaultController
|
||||||
{
|
{
|
||||||
public $permission = ['category'];
|
public $permission = ['category'];
|
||||||
|
|
||||||
// 枚举列表
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = [
|
$header = [
|
||||||
|
@ -153,7 +152,6 @@ class OptionController extends DefaultController
|
||||||
$header['search_form'] = $search;
|
$header['search_form'] = $search;
|
||||||
$header['js'] = Grid::js($header);
|
$header['js'] = Grid::js($header);
|
||||||
|
|
||||||
// 配置权限
|
|
||||||
return $this->display([
|
return $this->display([
|
||||||
'header' => $header,
|
'header' => $header,
|
||||||
]);
|
]);
|
||||||
|
@ -164,7 +162,6 @@ class OptionController extends DefaultController
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建字典
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -178,9 +175,6 @@ class OptionController extends DefaultController
|
||||||
], 'edit');
|
], 'edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存
|
|
||||||
*/
|
|
||||||
public function storeAction()
|
public function storeAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
@ -212,7 +206,6 @@ class OptionController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除字典
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -72,7 +72,6 @@ class RegionController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -82,7 +81,6 @@ class RegionController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
|
@ -129,7 +127,6 @@ class RegionController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -153,7 +153,6 @@ class SettingController extends DefaultController
|
||||||
$header['search_form'] = $search;
|
$header['search_form'] = $search;
|
||||||
$header['js'] = Grid::js($header);
|
$header['js'] = Grid::js($header);
|
||||||
|
|
||||||
// 配置权限
|
|
||||||
return $this->display([
|
return $this->display([
|
||||||
'header' => $header,
|
'header' => $header,
|
||||||
]);
|
]);
|
||||||
|
@ -161,13 +160,11 @@ class SettingController extends DefaultController
|
||||||
return $this->display();
|
return $this->display();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建邮箱帐号
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
return $this->editAction();
|
return $this->editAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑邮箱帐号
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -258,9 +255,6 @@ class SettingController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -164,7 +164,6 @@ class SmsController extends DefaultController
|
||||||
$header['search_form'] = $search;
|
$header['search_form'] = $search;
|
||||||
$header['js'] = Grid::js($header);
|
$header['js'] = Grid::js($header);
|
||||||
|
|
||||||
// 配置权限
|
|
||||||
return $this->display([
|
return $this->display([
|
||||||
'header' => $header,
|
'header' => $header,
|
||||||
]);
|
]);
|
||||||
|
@ -194,13 +193,11 @@ class SmsController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建短信帐号
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
return $this->editAction();
|
return $this->editAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑短信帐号
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -210,9 +207,6 @@ class SmsController extends DefaultController
|
||||||
], 'edit');
|
], 'edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -13,7 +13,7 @@ class SmsLogController extends DefaultController
|
||||||
public $permission = [];
|
public $permission = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 短信设置
|
* 短信记录
|
||||||
*/
|
*/
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
|
@ -147,9 +147,6 @@ class SmsLogController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -231,7 +231,6 @@ class WidgetController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建部件
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -260,7 +259,6 @@ class WidgetController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑部件
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
|
@ -271,9 +269,6 @@ class WidgetController extends DefaultController
|
||||||
return $this->editAction();
|
return $this->editAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除部件
|
|
||||||
*/
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -68,7 +68,6 @@ class GroupController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -78,13 +77,11 @@ class GroupController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -143,7 +143,7 @@ class MessageController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提醒设置
|
* 未读提醒
|
||||||
*/
|
*/
|
||||||
public function countAction()
|
public function countAction()
|
||||||
{
|
{
|
||||||
|
@ -154,9 +154,6 @@ class MessageController extends Controller
|
||||||
return response()->json($count);
|
return response()->json($count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除提醒
|
|
||||||
*/
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -69,7 +69,6 @@ class PositionController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建客户联系人
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -79,27 +78,11 @@ class PositionController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建客户联系人
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示客户联系人
|
|
||||||
public function showAction()
|
|
||||||
{
|
|
||||||
$id = (int)Request::get('id');
|
|
||||||
$position = UserPosition::find($id);
|
|
||||||
$options = [
|
|
||||||
'table' => 'user_position',
|
|
||||||
'row' => $position,
|
|
||||||
];
|
|
||||||
$tpl = Form::show($options);
|
|
||||||
return $this->display([
|
|
||||||
'tpl' => $tpl,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function dialogAction()
|
public function dialogAction()
|
||||||
{
|
{
|
||||||
$search = search_form([], [
|
$search = search_form([], [
|
||||||
|
@ -122,7 +105,6 @@ class PositionController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -56,7 +56,6 @@ class ProfileController extends DefaultController
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户信息
|
* 获取用户信息
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function getUserAction()
|
public function getUserAction()
|
||||||
{
|
{
|
||||||
|
@ -67,7 +66,6 @@ class ProfileController extends DefaultController
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新安全密钥
|
* 更新安全密钥
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function secretAction()
|
public function secretAction()
|
||||||
{
|
{
|
||||||
|
@ -81,7 +79,7 @@ class ProfileController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 修改密码 */
|
// 修改密码
|
||||||
public function passwordAction()
|
public function passwordAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -37,6 +37,5 @@ class RegionController extends DefaultController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo join("\n", $data);
|
echo join("\n", $data);
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,7 +248,6 @@ class RoleController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除角色
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -75,9 +75,9 @@ class TokenController extends Controller
|
||||||
|
|
||||||
$assets = UserAssetService::getRoleAssets($user->role_id);
|
$assets = UserAssetService::getRoleAssets($user->role_id);
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'token' => $this->createToken($user->id),
|
'user' => $user,
|
||||||
'access' => $assets,
|
'token' => $this->createToken($user->id),
|
||||||
'user' => $user,
|
'access' => $assets,
|
||||||
'success' => 1,
|
'success' => 1,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,6 @@ class UserController extends DefaultController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示用户
|
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -113,7 +112,6 @@ class UserController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新建用户
|
|
||||||
public function createAction()
|
public function createAction()
|
||||||
{
|
{
|
||||||
$id = (int)Request::get('id');
|
$id = (int)Request::get('id');
|
||||||
|
@ -123,7 +121,6 @@ class UserController extends DefaultController
|
||||||
], 'create');
|
], 'create');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑用户
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
return $this->createAction();
|
return $this->createAction();
|
||||||
|
@ -191,7 +188,6 @@ class UserController extends DefaultController
|
||||||
return $this->render(['tips' => $tips], 'layouts.import');
|
return $this->render(['tips' => $tips], 'layouts.import');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 账户删除
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -37,42 +37,6 @@ class EchoController extends Controller
|
||||||
$config = WechatService::getConfig();
|
$config = WechatService::getConfig();
|
||||||
$this->openid = $msg['FromUserName'];
|
$this->openid = $msg['FromUserName'];
|
||||||
|
|
||||||
// $fc = new \GdooWord('igb', database_path().'/dict.igb');
|
|
||||||
// $arr = $fc->getAutoWord($msg['Content']);
|
|
||||||
// Log::info('anc', $arr);
|
|
||||||
/*
|
|
||||||
$items = [
|
|
||||||
new NewsItem([
|
|
||||||
'title' => '某某某公司发货提醒',
|
|
||||||
'description' => "单据编号:123456\n发货时间:2020-01-12",
|
|
||||||
'url' => "http://israel.sinaapp.com/cet/index.php?openid=".$this->openid,
|
|
||||||
'image' => '',
|
|
||||||
]),
|
|
||||||
];
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
$items = [
|
|
||||||
new NewsItem([
|
|
||||||
'title' => '流程[办公用品采购]审核提醒',
|
|
||||||
'description' => "转交人:李先生\n时间:2020-01-12",
|
|
||||||
'url' => "http://shenghua.test/index.php?openid=".$this->openid,
|
|
||||||
'image' => '',
|
|
||||||
]),
|
|
||||||
];
|
|
||||||
|
|
||||||
$news = new News($items);
|
|
||||||
return $news;
|
|
||||||
|
|
||||||
$msg = new Text("订单发货最新三条\n1.单据编号:123456,发货时间:2020-01-12,件数:123,金额:100\n2.单据编号:123456,发货时间:2020-01-12,件数:123,金额:100\n2.单据编号:123456,发货时间:2020-01-12,件数:123,金额:100");
|
|
||||||
$msg = new Text("促销最新三条\n1.单据编号:123456,发货时间:2020-01-12,件数:123,金额:100\n2.单据编号:123456,发货时间:2020-01-12,件数:123,金额:100\n2.单据编号:123456,发货时间:2020-01-12,件数:123,金额:100");
|
|
||||||
$msg = new Text("进店最新三条\n1.单据编号:123456,发货时间:2020-01-12,件数:123,金额:100\n2.单据编号:123456,发货时间:2020-01-12,件数:123,金额:100\n2.单据编号:123456,发货时间:2020-01-12,件数:123,金额:100");
|
|
||||||
|
|
||||||
return $msg;
|
|
||||||
*/
|
|
||||||
//print_R($arr);
|
|
||||||
//exit;
|
|
||||||
|
|
||||||
if ($config['status'] == 0) {
|
if ($config['status'] == 0) {
|
||||||
return '服务关闭中,请稍后再试。';
|
return '服务关闭中,请稍后再试。';
|
||||||
}
|
}
|
||||||
|
@ -82,11 +46,10 @@ class EchoController extends Controller
|
||||||
return $msg['Content'];
|
return $msg['Content'];
|
||||||
break;
|
break;
|
||||||
case 'image':
|
case 'image':
|
||||||
//$this->special('image', $msg);
|
return $msg['Content'];
|
||||||
break;
|
break;
|
||||||
case 'voice':
|
case 'voice':
|
||||||
return $msg['Content'];
|
return $msg['Content'];
|
||||||
//$this->special('voice', $msg);
|
|
||||||
break;
|
break;
|
||||||
case 'video':
|
case 'video':
|
||||||
return '收到视频消息';
|
return '收到视频消息';
|
||||||
|
@ -211,22 +174,15 @@ class EchoController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function replyNews($msg) {
|
public function replyArticle($msg) {
|
||||||
$temple = DB::table('house_temple')->where('ticket', $msg['Ticket'])->first();
|
|
||||||
$this->we->reply([
|
$this->we->reply([
|
||||||
'type' => 'news',
|
'type' => 'news',
|
||||||
'articles' => [[
|
'articles' => [[
|
||||||
'title' => $temple['name'],
|
'title' => '关注',
|
||||||
'description' => $temple['remark'],
|
'description' => '关注',
|
||||||
'picurl' => url('uploads/'.$temple['image']),
|
'picurl' => '',
|
||||||
'url' => url('wap/index/info', ['id' => $temple['id']]),
|
'url' => '',
|
||||||
],[
|
]]
|
||||||
'title' => '立即供灯',
|
|
||||||
'description' => '立即供灯',
|
|
||||||
'picurl' => '',
|
|
||||||
'url' => url('wap/light/index', ['temple_id' => $temple['id']]),
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +193,7 @@ class EchoController extends Controller
|
||||||
{
|
{
|
||||||
// 有场景参数
|
// 有场景参数
|
||||||
if (isset($msg['Ticket'])) {
|
if (isset($msg['Ticket'])) {
|
||||||
$this->replyNews($msg);
|
$this->replyArticle($msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ use Gdoo\Model\Models\Bill;
|
||||||
|
|
||||||
class CategoryController extends DefaultController
|
class CategoryController extends DefaultController
|
||||||
{
|
{
|
||||||
// 流程类别
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$header = [
|
$header = [
|
||||||
|
@ -188,7 +187,6 @@ class CategoryController extends DefaultController
|
||||||
return $this->editAction();
|
return $this->editAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除流程类别
|
|
||||||
public function deleteAction()
|
public function deleteAction()
|
||||||
{
|
{
|
||||||
if (Request::method() == 'POST') {
|
if (Request::method() == 'POST') {
|
||||||
|
|
|
@ -1,88 +0,0 @@
|
||||||
<?php namespace Gdoo\Workflow\Controllers;
|
|
||||||
|
|
||||||
use DB;
|
|
||||||
use Request;
|
|
||||||
|
|
||||||
use Gdoo\Workflow\Models\Workflow;
|
|
||||||
use Gdoo\Workflow\Models\WorkflowCategory;
|
|
||||||
|
|
||||||
use Gdoo\Index\Controllers\DefaultController;
|
|
||||||
|
|
||||||
class DesignController extends DefaultController
|
|
||||||
{
|
|
||||||
public function indexAction()
|
|
||||||
{
|
|
||||||
$search = search_form([
|
|
||||||
'referer' => 1
|
|
||||||
], [
|
|
||||||
['text','work.title','流程名称'],
|
|
||||||
['text','work.id','流程编号'],
|
|
||||||
['category','work.category_id','流程类别'],
|
|
||||||
]);
|
|
||||||
$query = $search['query'];
|
|
||||||
|
|
||||||
$model = Workflow::query();
|
|
||||||
|
|
||||||
foreach ($search['where'] as $where) {
|
|
||||||
if ($where['active']) {
|
|
||||||
$model->search($where);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$rows = $model->paginate()->appends($query);
|
|
||||||
|
|
||||||
$counts = DB::table('work_process')
|
|
||||||
->selectRaw('work_id,count(id) as count')
|
|
||||||
->groupBy('work_id')
|
|
||||||
->pluck('count', 'work_id');
|
|
||||||
|
|
||||||
$categorys = WorkflowCategory::get()->keyBy('id');
|
|
||||||
return $this->display(array(
|
|
||||||
'rows' => $rows,
|
|
||||||
'counts' => $counts,
|
|
||||||
'categorys' => $categorys,
|
|
||||||
'search' => $search,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addAction()
|
|
||||||
{
|
|
||||||
$gets = Request::all();
|
|
||||||
$model = Workflow::findOrNew($gets['id']);
|
|
||||||
|
|
||||||
if (Request::method() == 'POST') {
|
|
||||||
if (empty($gets['title'])) {
|
|
||||||
return $this->error('流程名称必须填写。');
|
|
||||||
}
|
|
||||||
$model->fill($gets)->save();
|
|
||||||
return $this->success('index', '工作流程保存成功。');
|
|
||||||
}
|
|
||||||
|
|
||||||
$row = Workflow::find($gets['id']);
|
|
||||||
$category = WorkflowCategory::get();
|
|
||||||
|
|
||||||
return $this->display(array(
|
|
||||||
'row' => $row,
|
|
||||||
'category' => $category,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function processAction()
|
|
||||||
{
|
|
||||||
$this->view->set(array(
|
|
||||||
'row' => $row,
|
|
||||||
));
|
|
||||||
return $this->display();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除流程
|
|
||||||
public function deleteAction()
|
|
||||||
{
|
|
||||||
$id = Request::get('id', 0);
|
|
||||||
if ($id > 0) {
|
|
||||||
// 此处应该删除所有的有关的文件
|
|
||||||
Workflow::where('id', $id)->delete();
|
|
||||||
return $this->success('index', '工作流删除成功。');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue