dataLists(new CustomerLists()); } /** * @notes 同步企业微信客户 */ public function sync() { $result = CustomerLogic::triggerBackgroundSync(); if ($result === false) { return $this->fail(CustomerLogic::getError()); } $msg = is_array($result) && isset($result['message']) ? (string) $result['message'] : '已提交同步'; return $this->success($msg, $result); } /** * @notes 获取统计信息 */ public function stats() { $stats = CustomerLogic::getStats(); return $this->data($stats); } /** * @notes 获取同步设置 */ public function getSyncSettings() { $settings = CustomerLogic::getSyncSettings(); return $this->data($settings); } /** * @notes 保存同步设置 */ public function saveSyncSettings() { $params = (new CustomerValidate())->post()->goCheck('syncSettings'); $result = CustomerLogic::saveSyncSettings($params); if ($result === false) { return $this->fail(CustomerLogic::getError()); } return $this->success('保存成功'); } }